-
Gradle and JUnit example
In Gradle, you can declare the JUnit dependency like this:
2019-08-17【[Java]】
阅读更多 -
Hamcrest How to assertThat check null value?
Try to check null value with the Hamcrest assertThat assertion, but no idea how?
2019-08-17【[Java]】
阅读更多 -
JUnit How to test a List
First, exclude the JUnit bundled copy of hamcrest-core, and include the useful hamcrest-library, it contains many useful methods to test the List data type.
2019-08-17【[Java]】
阅读更多 -
JUnit How to test a Map
Forget about JUnit assertEquals(), to test a Map, uses the more expressive IsMapContaining class from hamcrest-library.jar
2019-08-17【[Java]】
阅读更多 -
JUnit Assert if a property exists in a class
Includes hamcrest-library and test the class property and its value with hasProperty() :
2019-08-17【[Java]】
阅读更多