Merge remote-tracking branch 'origin/master'

This commit is contained in:
law39 2020-05-01 15:38:05 +01:00
commit b4db0f49cc

View file

@ -1,9 +1,14 @@
/**
* @(#) DictionaryEntryTest.java 0,1 2020/05/01
* <p>
* Copyright (c) 2020 Aberystwyth University.
* All rights reserved.
*/
package uk.ac.aber.cs221.group20.test;
import org.junit.jupiter.api.Test;
import uk.ac.aber.cs221.group20.json.DictionaryEntry;
import uk.ac.aber.cs221.group20.json.JsonProcessing;
import java.util.*;
@ -11,7 +16,7 @@ import static org.junit.jupiter.api.Assertions.*;
/**
* A test class for various tests regarding DictionaryEntry.
* @Author Kab74
* @author Kain Bryan-Jones [kab74]
*/
class DictionaryEntryTest {
@ -33,7 +38,7 @@ class DictionaryEntryTest {
void testAllSettersAndGetters() {
String english = "abbey";
String welsh = "abaty";
wordTypeEnum wordType = wordTypeEnum.nm;
DictionaryEntry.wordTypeEnum wordType = DictionaryEntry.wordTypeEnum.nm;
DictionaryEntry testSettersAndGetters = new DictionaryEntry();
testSettersAndGetters.setEnglish(english);
@ -42,7 +47,7 @@ class DictionaryEntryTest {
assertTrue(testSettersAndGetters.getEnglish().equals(english) &&
testSettersAndGetters.getWelsh().equals(welsh) &&
testSettersAndGetters.getWordType().equals(wordType));
}
}
/**
* A true-positive test for the equals method in DictionaryEntry.
@ -51,7 +56,7 @@ class DictionaryEntryTest {
public void testEqualsTruePossitive() {
String english = "abbey";
String welsh = "abaty";
wordTypeEnum wordType = wordTypeEnum.nm;
DictionaryEntry.wordTypeEnum wordType = DictionaryEntry.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)));
}
@ -61,7 +66,7 @@ class DictionaryEntryTest {
*/
@Test
public void testEqualsTrueNegative(){
testList = new LinkedList<>(Arrays.asList(new DictionaryEntry("abbey","abaty", wordTypeEnum.nm),new DictionaryEntry("above","dramor",wordTypeEnum.other)));
testList = new LinkedList<>(Arrays.asList(new DictionaryEntry("abbey","abaty", DictionaryEntry.wordTypeEnum.nm),new DictionaryEntry("above","dramor", DictionaryEntry.wordTypeEnum.other)));
assertFalse(testList.get(0).equals(testList.get(1)));
}