Source code of the examples from "Practical Unit Testing with TestNG and Mockito"
Java Groovy
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
chp_02_financial_service/src/main/java/com/practicalunittesting
chp_03_client/src
chp_03_money/src
chp_04_client/src
chp_04_football_team/src
chp_05_car/src
chp_05_mock_or_not/src
chp_05_race_results/src
chp_05_test_doubles/src
chp_06_collections/src
chp_06_excel_read/src
chp_06_expected_exceptions/src
chp_06_id_generator/src
chp_06_matchers/src
chp_06_mockito_matchers/src
chp_06_stubbing_void/src
chp_06_time/src
chp_07_capturing_arguments/src
chp_07_how_many_assertions/src
chp_07_new_operator/src
README.asciidoc
build.gradle
settings.gradle

README.asciidoc

Basic Info

This project contains all the source code of examples for "Practical Unit Testing with TestNG and Mockito".

See the book’s website: http://practicalunittesting.com

Import project to your IDE

Eclipse

First you need to generate Eclipse project files. If you have Gradle installed then type

gradle eclipse

In other cases (this will take some time - first Gradle will be downloaded):

./gradlew eclipse

After this you can import this project to Eclipse as any other project (File / Import / General / Existing Project into Workspace). As far as I know (not being an Eclipse guru!) you need to import each project individually.

IntelliJ IDEA

You can import files by choosing:

  • File / New Project / Import project from external module

  • select Gradle

  • and then select build.gradle file

Content

For your convenience all exercises are kept in separate dirs with names like "chp_X_exercise_name" where X is the chapter number:

TODO more of them in examples

  • Chapter 2 "Developers Tests"

  • Chapter 3 "Unit Tests with no Collaborators"

  • Chapter 4 "Test Driven Development"

  • Chapter 5 "Mocks, Stubs, Test Spies"

  • Chapter 6 "Things You Should Know"

  • Chapter 7 "Points of Controversy"

  • Chapter 8 "Getting Feedback"

  • Chapter 9 "Organization of Tests"

  • Chapter 10 "Maintainable Tests"

  • Chapter 11 "Test Quality"

Some tests fail - yes, on purpose

TODO