Line | |
---|
1 | package tudelft.mentalhealth.motivatepersisting;
|
---|
2 |
|
---|
3 | import static org.junit.Assert.assertEquals;
|
---|
4 |
|
---|
5 | import java.io.IOException;
|
---|
6 | import java.util.Locale;
|
---|
7 |
|
---|
8 | import org.junit.Test;
|
---|
9 |
|
---|
10 | import tudelft.utilities.statistic.WeightedSet;
|
---|
11 |
|
---|
12 | public class StatementsTest {
|
---|
13 |
|
---|
14 | private static final Locale NL = new Locale("nl", "NL");
|
---|
15 |
|
---|
16 | @Test
|
---|
17 | public void smokeTest() throws IOException {
|
---|
18 | new Statements(NL);
|
---|
19 | }
|
---|
20 |
|
---|
21 | @Test(expected = IllegalStateException.class)
|
---|
22 | public void smokeTestFrench() throws IOException {
|
---|
23 | new Statements(Locale.FRENCH);
|
---|
24 | }
|
---|
25 |
|
---|
26 | @Test
|
---|
27 | public void testTogether() throws IOException {
|
---|
28 | WeightedSet<String> texts = new Statements(NL)
|
---|
29 | .getStatements(Category.TOGETHER, Subcategory.ALL);
|
---|
30 | assertEquals((Double) 20d, texts.getSum());
|
---|
31 | assertEquals("Laten we kijken hoe we dit kunnen omkeren.",
|
---|
32 | texts.get(12d));
|
---|
33 | }
|
---|
34 |
|
---|
35 | @Test
|
---|
36 | public void testNotepcl() throws IOException {
|
---|
37 | WeightedSet<String> texts = new Statements(NL)
|
---|
38 | .getStatements(Category.NOTEPCL, Subcategory.DROPPING);
|
---|
39 | assertEquals((Double) 68d, texts.getSum());
|
---|
40 | assertEquals("Je klachten verminderen, de behandeling slaat aan.",
|
---|
41 | texts.get(37d));
|
---|
42 | }
|
---|
43 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.