Added New Iterable Feature
-Added: Repeating iterable/iterator/async feature which allows to repeate collections a desired amount of times. -Added: Tests for it.
This commit is contained in:
+2
@@ -39,6 +39,7 @@ import speiger.src.testers.PACKAGE.tests.iterable.FILE_KEY_TYPEIterableMapTester
|
||||
import speiger.src.testers.PACKAGE.tests.iterable.FILE_KEY_TYPEIterableMatchesTester;
|
||||
import speiger.src.testers.PACKAGE.tests.iterable.FILE_KEY_TYPEIterablePeekTester;
|
||||
import speiger.src.testers.PACKAGE.tests.iterable.FILE_KEY_TYPEIterableReduceTester;
|
||||
import speiger.src.testers.PACKAGE.tests.iterable.FILE_KEY_TYPEIterableRepeatTester;
|
||||
import speiger.src.testers.PACKAGE.tests.iterable.FILE_KEY_TYPEIterableSortedTester;
|
||||
#endif
|
||||
|
||||
@@ -63,6 +64,7 @@ public class COLLECTION_TEST_BUILDER KEY_GENERIC_TYPE extends CollectionTestSuit
|
||||
testers.add(FILE_KEY_TYPEIterableMatchesTester.class);
|
||||
testers.add(FILE_KEY_TYPEIterablePeekTester.class);
|
||||
testers.add(FILE_KEY_TYPEIterableReduceTester.class);
|
||||
testers.add(FILE_KEY_TYPEIterableRepeatTester.class);
|
||||
testers.add(FILE_KEY_TYPEIterableCountTester.class);
|
||||
testers.add(FILE_KEY_TYPEIterableFindFirstTester.class);
|
||||
#endif
|
||||
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package speiger.src.testers.PACKAGE.tests.iterable;
|
||||
|
||||
import org.junit.Ignore;
|
||||
|
||||
import com.google.common.collect.testing.features.CollectionSize;
|
||||
|
||||
import speiger.src.collections.PACKAGE.lists.ARRAY_LIST;
|
||||
import speiger.src.collections.PACKAGE.lists.LIST;
|
||||
import speiger.src.testers.PACKAGE.tests.base.ABSTRACT_COLLECTION_TESTER;
|
||||
|
||||
@Ignore
|
||||
@SuppressWarnings("javadoc")
|
||||
public class FILE_KEY_TYPEIterableRepeatTester KEY_GENERIC_TYPE extends ABSTRACT_COLLECTION_TESTER KEY_GENERIC_TYPE
|
||||
{
|
||||
#ignore
|
||||
@CollectionSize.Require(absent = CollectionSize.ZERO)
|
||||
#endignore
|
||||
public void testIterableRepeat() {
|
||||
LIST KEY_GENERIC_TYPE expected = new ARRAY_LISTBRACES();
|
||||
expected.addAll(collection);
|
||||
expected.addAll(collection);
|
||||
expected.addAll(collection);
|
||||
LIST KEY_GENERIC_TYPE result = collection.repeat(2).pourAsList();
|
||||
assertEquals(expected.size(), result.size());
|
||||
assertEquals("Repeat does not retain the iteration order", expected, result);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user