Answers for "what is hamcrest for"

0

what is hamcrest for

Hamcrest is a framework for writing matcher objects
allowing 'match' rules to be defined declaratively.


import org.junit.jupiter.api.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
public class BiscuitTest {
@Test
public void testEquals() {
Biscuit theBiscuit = new Biscuit("Ginger");
Biscuit myBiscuit = new Biscuit("Ginger");
assertThat(theBiscuit, equalTo(myBiscuit));
Posted by: Guest on December-04-2020

Browse Popular Code Answers by Language