package tudelft.mentalhealth.motivatepersisting; import static org.junit.Assert.assertEquals; import java.io.IOException; import java.util.Locale; import org.junit.Test; import tudelft.utilities.statistic.WeightedSet; public class StatementsTest { private static final Locale NL = new Locale("nl", "NL"); @Test public void smokeTest() throws IOException { new Statements(NL); } @Test(expected = IllegalStateException.class) public void smokeTestFrench() throws IOException { new Statements(Locale.FRENCH); } @Test public void testTogether() throws IOException { WeightedSet texts = new Statements(NL) .getStatements(Category.TOGETHER, Subcategory.ALL); assertEquals((Double) 20d, texts.getSum()); assertEquals("Laten we kijken hoe we dit kunnen omkeren.", texts.get(12d)); } @Test public void testNotepcl() throws IOException { WeightedSet texts = new Statements(NL) .getStatements(Category.NOTEPCL, Subcategory.DROPPING); assertEquals((Double) 68d, texts.getSum()); assertEquals("Je klachten verminderen, de behandeling slaat aan.", texts.get(37d)); } }