-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathTestExample.java
More file actions
33 lines (24 loc) · 773 Bytes
/
Copy pathTestExample.java
File metadata and controls
33 lines (24 loc) · 773 Bytes
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
package ru.odnoklassniki.homework;
import org.hamcrest.Matchers;
import org.junit.*;
import ru.odnoklassniki.ClassToBeTested;
import java.util.List;
import static org.hamcrest.Matchers.equalTo;
/**
* Created by danny on 15.04.18 at 10:23.
**/
public class TestExample {
private List<String> list;
@Before
public void init() throws Exception{
list=ClassToBeTested.sortStringsByLength("World!","Hello");
}
@Test(timeout = 10000)
public void testHasItem(){
Assert.assertThat(("list has not value"),list, Matchers.hasItem(equalTo("Hello")));
}
@Test(timeout = 10000)
public void testHasValue(){
Assert.assertThat("String does not match",list.get(1),Matchers.<String>hasToString(equalTo("Hello")));
}
}