From 6de32a77c0744bbaa85e8b79bcc685cdb6481afa Mon Sep 17 00:00:00 2001 From: kab74 Date: Fri, 1 May 2020 13:44:31 +0100 Subject: [PATCH] Fixed issues with selfAssessment package --- .../cs22120/group20/test/DictionaryEntryTest.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/test/DictionaryEntryTest.java b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/test/DictionaryEntryTest.java index 63b7976..bbcc870 100644 --- a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/test/DictionaryEntryTest.java +++ b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/test/DictionaryEntryTest.java @@ -1,17 +1,20 @@ package uk.ac.aber.cs22120.group20.test; import org.junit.jupiter.api.Test; +import uk.ac.aber.cs22120.group20.json.DictionaryEntry.*; import uk.ac.aber.cs22120.group20.json.DictionaryEntry; -import uk.ac.aber.cs22120.group20.json.JsonProcessing; import java.util.*; import static org.junit.jupiter.api.Assertions.*; +/** + * A test class for various tests regarding DictionaryEntry. + * @Author Kab74 + */ class DictionaryEntryTest { LinkedList testList; - JsonProcessing processor = new JsonProcessing(); /** * Tests whether the default constructor sets isPracticeWord to false upon declaration of a new DictionaryEntry. @@ -29,7 +32,8 @@ class DictionaryEntryTest { void testAllSettersAndGetters() { String english = "abbey"; String welsh = "abaty"; - String wordType = "nm"; + wordTypeEnum wordType = wordTypeEnum.nm; + DictionaryEntry testSettersAndGetters = new DictionaryEntry(); testSettersAndGetters.setEnglish(english); testSettersAndGetters.setWelsh(welsh); @@ -46,7 +50,7 @@ class DictionaryEntryTest { public void testEqualsTruePossitive() { String english = "abbey"; String welsh = "abaty"; - String wordType = "nm"; + wordTypeEnum wordType = wordTypeEnum.nm; testList = new LinkedList<>(Arrays.asList(new DictionaryEntry(english,welsh,wordType),new DictionaryEntry(english,welsh,wordType))); assertTrue(testList.get(0).equals(testList.get(1))); } @@ -56,7 +60,7 @@ class DictionaryEntryTest { */ @Test public void testEqualsTrueNegative(){ - testList = new LinkedList<>(Arrays.asList(new DictionaryEntry("abbey","abaty","nm"),new DictionaryEntry("above","dramor","other"))); + testList = new LinkedList<>(Arrays.asList(new DictionaryEntry("abbey","abaty", wordTypeEnum.nm),new DictionaryEntry("above","dramor",wordTypeEnum.other))); assertFalse(testList.get(0).equals(testList.get(1))); }