Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package langModel;
- import org.junit.jupiter.api.Test;
- import java.util.HashSet;
- import java.util.Set;
- import static org.junit.Assert.*;
- public class VocabularyTest
- {
- @Test
- public void getSizeTest()
- {
- Vocabulary voc = new Vocabulary();
- voc.addWord("Pizza");
- voc.addWord("LoL");
- voc.addWord("Chorizo");
- assertEquals(voc.getSize(), 3);
- }
- @Test
- public void getWordsTest()
- {
- Vocabulary voc = new Vocabulary();
- voc.addWord("Pizza");
- voc.addWord("LoL");
- voc.addWord("Chorizo");
- Set<String> test = new HashSet<>();
- test.add("Pizza");
- test.add("LoL");
- test.add("Chorizo");
- assertEquals(voc.getWords(), test);
- }
- @Test
- public void containsTest()
- {
- Vocabulary voc = new Vocabulary();
- voc.addWord("Pizza");
- voc.addWord("LoL");
- voc.addWord("Chorizo");
- assertTrue(voc.contains("Pizza"));
- }
- @Test
- public void addWordTest()
- {
- Vocabulary voc = new Vocabulary();
- voc.addWord("Pizza");
- voc.addWord("LoL");
- voc.addWord("Chorizo");
- assertTrue(voc.contains("Chorizo"));
- }
- @Test
- public void removeWordTest()
- {
- Vocabulary voc = new Vocabulary();
- voc.addWord("Pizza");
- voc.addWord("LoL");
- voc.addWord("Chorizo");
- voc.removeWord("Chorizo");
- assertFalse(voc.contains("Chorizo"));
- }
- @Test
- public void scanNgramSetTest()
- {
- }
- @Test
- public void readVocabularyFileTest()
- {
- }
- @Test
- public void writeVocabularyFileTest()
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement