Fixed Unit Tests
This commit is contained in:
+5
-1
@@ -7,7 +7,9 @@ import com.google.common.collect.testing.features.CollectionSize;
|
||||
import speiger.src.collections.PACKAGE.collections.COLLECTION;
|
||||
import speiger.src.collections.PACKAGE.lists.ARRAY_LIST;
|
||||
import speiger.src.testers.PACKAGE.tests.base.ABSTRACT_LIST_TESTER;
|
||||
#if !TYPE_BOOLEAN
|
||||
import speiger.src.testers.PACKAGE.utils.MINIMAL_SET;
|
||||
#endif
|
||||
|
||||
@Ignore
|
||||
@SuppressWarnings("javadoc")
|
||||
@@ -38,8 +40,10 @@ public class FILE_KEY_TYPEListEqualsTester KEY_GENERIC_TYPE extends ABSTRACT_LIS
|
||||
COLLECTION KEY_GENERIC_TYPE moreElements = getSampleElements(getNumElements() + 1);
|
||||
assertFalse("Lists of different sizes should not be equal.", getList().equals(new ARRAY_LISTBRACES(moreElements)));
|
||||
}
|
||||
|
||||
|
||||
#if !TYPE_BOOLEAN
|
||||
public void testEquals_set() {
|
||||
assertFalse("A List should never equal a Set.", getList().equals(MINIMAL_SET.of(getList())));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
+2
-10
@@ -94,22 +94,14 @@ public class PAIRTester KEY_VALUE_GENERIC_TYPE extends TestCase
|
||||
|
||||
@Test
|
||||
public void testKeyMatching() {
|
||||
#if TYPE_OBJECT
|
||||
PAIR KEY_VALUE_GENERIC_TYPE pair = keyConstructor.getObject(getKey());
|
||||
#else
|
||||
PAIR KEY_VALUE_GENERIC_TYPE pair = keyConstructor.GET_VALUE(getKey());
|
||||
#endif
|
||||
PAIR KEY_VALUE_GENERIC_TYPE pair = keyConstructor.apply(getKey());
|
||||
assertEquals(getKey(), pair.ENTRY_KEY());
|
||||
assertEquals(EMPTY_VALUE, pair.ENTRY_VALUE());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValueMatching() {
|
||||
#if VALUE_OBJECT
|
||||
PAIR KEY_VALUE_GENERIC_TYPE pair = valueConstructor.getObject(getValue());
|
||||
#else
|
||||
PAIR KEY_VALUE_GENERIC_TYPE pair = valueConstructor.get(getValue());
|
||||
#endif
|
||||
PAIR KEY_VALUE_GENERIC_TYPE pair = valueConstructor.apply(getValue());
|
||||
assertEquals(EMPTY_KEY_VALUE, pair.ENTRY_KEY());
|
||||
assertEquals(getValue(), pair.ENTRY_VALUE());
|
||||
}
|
||||
|
||||
+3
-3
@@ -9,7 +9,7 @@ import org.junit.Ignore;
|
||||
import com.google.common.collect.testing.features.CollectionSize;
|
||||
|
||||
import speiger.src.collections.PACKAGE.collections.COLLECTION;
|
||||
import speiger.src.collections.PACKAGE.utils.SETS;
|
||||
import speiger.src.collections.PACKAGE.utils.COLLECTIONS;
|
||||
import speiger.src.testers.PACKAGE.tests.base.ABSTRACT_QUEUE_TESTER;
|
||||
|
||||
@Ignore
|
||||
@@ -24,7 +24,7 @@ public class FILE_KEY_TYPEQueueFilterTester KEY_GENERIC_TYPE extends ABSTRACT_QU
|
||||
@CollectionSize.Require(absent = CollectionSize.ZERO)
|
||||
#endignore
|
||||
public void testQueueFilter_filterElement() {
|
||||
assertFalse(expectMissing(SETS.singleton(e0()), queue.filter(T -> KEY_EQUALS(T, e0())).pourAsList().TO_ARRAY()));
|
||||
assertFalse(expectMissing(COLLECTIONS.singleton(e0()), queue.filter(T -> KEY_EQUALS(T, e0())).pourAsList().TO_ARRAY()));
|
||||
}
|
||||
|
||||
#ignore
|
||||
@@ -38,7 +38,7 @@ public class FILE_KEY_TYPEQueueFilterTester KEY_GENERIC_TYPE extends ABSTRACT_QU
|
||||
@CollectionSize.Require(CollectionSize.SEVERAL)
|
||||
#endignore
|
||||
public void testQueueFilter_filterSeveral() {
|
||||
assertTrue(expectMissing(SETS.singleton(e1()), queue.filter(T -> KEY_EQUALS_NOT(T, e1())).pourAsList().TO_ARRAY()));
|
||||
assertTrue(expectMissing(COLLECTIONS.singleton(e1()), queue.filter(T -> KEY_EQUALS_NOT(T, e1())).pourAsList().TO_ARRAY()));
|
||||
}
|
||||
|
||||
protected boolean expectMissing(COLLECTION KEY_GENERIC_TYPE result, KEY_OBJECT_TYPE...elements)
|
||||
|
||||
Reference in New Issue
Block a user