/
ProductionLineTest.java
43 lines (33 loc) · 1.32 KB
/
ProductionLineTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package ru.yandex.qatools.examples;
import org.junit.Test;
import ru.yandex.qatools.examples.data.FruitFactory;
import java.awt.*;
import java.util.Collection;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static ru.yandex.qatools.examples.matchers.OrangeMatchers.*;
/**
* Created with IntelliJ IDEA.
* User: lanwen
* Date: 22.05.13
* Time: 13:06
*/
public class ProductionLineTest {
private Collection<Fruit> fruitList = FruitFactory.createFruitsList();
@Test
public void orangeListBothSweetRoundAndOrangeColorWithMatchers() throws Exception {
assertThat(fruitList, everyItem(both(round()).and(sweet()).and(hasColor(Color.ORANGE))));
}
@Test
public void notAllOrangeListBothSweetRoundAndOrangeColorWithMatchers() throws Exception {
assertThat(fruitList, everyItem(both(round()).and(sweet()).and(hasColor(Color.ORANGE))));
}
@Test
public void hasOrangeInListBothSweetRoundAndOrangeColorWithMatchers() throws Exception {
assertThat(fruitList, hasItem(both(round()).and(sweet()).and(hasColor(Color.ORANGE))));
}
@Test
public void hasntOrangeInListBothSweetRoundAndOrangeColorWithMatchers() throws Exception {
assertThat(fruitList, hasItem(both(round()).and(sweet()).and(hasColor(Color.ORANGE))));
}
}