How to use Hamcrest to make unit tests more expressive
How to use Hamcrest to increase unit testing capability
How to use Hamcrest to ease unit testing development
How to write and run custom Hamcrest matchers
Requirements
- Basic abilities with Java and Junit.
- Basic abilities with an IDE.
Description
JUnit is one of Java’s most popular unit testing frameworks. Hamcrest is an additional layer that sits on top of JUnit, and it allows you to write expressive and developer-friendly unit tests. In this course, you will learn which imports to use, how to write and run Hamcrest tests, how to use Hamcrest’s fundamental methods, and how to write your own custom Hamcrest matchers. No prior knowledge of Hamcrest is necessary. The course is example-driven instruction and includes guided practice and quizzes to strengthen your understanding. Basic knowledge of Java programming and JUnit is required.
Who this course is for:
- Developers looking to add Hamcrest into their unit testing
- Students wishing to learn Hamcrest
- Academics wishing to learn development tools used in industry
- Software team leaders looking to evaluate Hamcrest as a development tool
Course content
5 sections • 18 lectures • 44m total lengthExpand all sections
Introduction8 lectures • 15min
- Hamcrest source code.00:03
- Introduction00:49
- assertThat(), equalTo() methods02:07
- String methods02:33
- Number methods02:50
- Expressive syntax01:33
- Matcher practice 102:49
- Matcher practice 201:58
- Quiz 15 questions
Hamcrest In Greater Depth4 lectures • 12min
- Array methods02:05
- Collection methods04:23
- Object methods, anything()03:56
- Matcher practice 302:00
- Quiz 26 questions
Custom Hamcrest Matchers4 lectures • 14min
- Custom Hamcrest matcher: IsOdd03:46
- Custom Hamcrest Matcher: Sum03:13
- Write Your Own Custom Matcher: StartsWith03:40
- Write Your Own Custom Matcher: AlphaNumeric03:32
Beans1 lecture • 3min
- Methods for Java Beans02:38
Course Conclusion1 lecture • 1min
- Course Conclusion00:35