Posted In: Hamcrest, Junit, Testing

How to unit test a date – JUnit + Hamcrest

Usecase – You need to unit test Date output and write multiple scenarios to test the data. Hamcrest library may be useful to achieve that Hamcrest Date Matchers Hamcrest 1.3 Classes used from Hamcrest import org.hamcrest.number.OrderingComparison; Using ErrorCollector so that execution continues even if assert statement fails. Output

Read More

Tags: ,

by , on August 13th, 2017

  • Categories