import org.junit.Test;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.assertThat;
public class SampleTest {
@Test
public void test_containsString(){
String actual = "terran";
assertThat(actual, containsString("rr"));
}
@Test
public void test_both_either() {
String actual = "albumen";
// both A and B
assertThat(actual, both(containsString("a"))
.and(containsString("b"))
.and(containsString("e"))
);
// either A or B
assertThat(actual, either(containsString("u"))
.or(containsString("Z"))
.or(containsString("p")
));
}
}
댓글 영역