Sep 272012
JUnit 4.4 added a new assertion mechanism with the method assertThat(). Have a look and consider using it in place of assertEquals().
assertThat(result, is(42)); |
assertThat(output, containsString("foo")); |
JUnit 4.4 added a new assertion mechanism with the method assertThat(). Have a look and consider using it in place of assertEquals().
assertThat(result, is(42)); |
assertThat(output, containsString("foo")); |
[...] Consider assertThat() in place of assertEquals() (CodeAwesome) [...]
Why? I cant understand why i supposed to leave the AssertEquals instead AssertThat. Can you give a explanation? Thanks!
@Ramiro have a look at the link titled “JUnit 4.4 added a new assertion mechanism” for further, interesting details.