GithubHelp home page GithubHelp logo

ahgang / unit-test-mock-basic-2019-6-14-3-33-53-188 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from recruiting-system/unit-test-mock-basic-2019-6-14-3-33-53-188

0.0 1.0 0.0 56 KB

Java 100.00%

unit-test-mock-basic-2019-6-14-3-33-53-188's Introduction

Unit Test Mock Basic - Mocks and Stubs Dojo

Business Requirement

Exercise Test 1

Due to a cash register implementation. Begin by writing a test that asserts the cash register prints something to the printer. Do not use a mocking framework like mockito.

Exercise Test 2

Assert that the printer prints exactly a test string you provide in the test.

Exercise Test 3

Replace your hand crafted mocks and stubs with a mocking framework.

Practice Requirement:

  • ** Write test one by one after clearly understanding the implemented code**
  • ** Complete tests in the existing test file CashRegisterTest
  • Unit testing should cover all core business logic
  • ** Submit code in small steps with a comment on meaning **
  • Complete unit tests on the corresponding file under the src/test catalog of project

Environment Requirement

  • Java 8
  • Intellj IDEA
  • Mockito
  • Gradle

How to Start

  • You can fork the following github repository as starting point
  • Please submit your own github repository address in the answer field.

How to Test

  • Implement ./gradlew clean test under root catalogue and view test result

Practice Output && Submit

  • You should implement the test code and push your repo to github repo named unit-test-mock-basic.
  • Commit your repostory link to complete this Question.

unit-test-mock-basic-2019-6-14-3-33-53-188's People

Contributors

ahgang avatar linwenjun avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.