public void Test_findNextPrime_dataCut() { // Arrange int[] seq = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; int prime = 6; dataCut objLARGE = new dataCut(prime, seq); dataCut objSMALL = new dataCut(prime, seq); dataCut objNullLARGE = new dataCut(prime); dataCut objNullSMALL = new dataCut(prime); int[] expectedLARGE = new int[] { 8, 9 }; int[] expectedSMALL = new int[] { 2, 3, 4, 5, 6 }; int[] expectedNullLARGE = new int[] { 7 }; int[] expectedNullSMALL = new int[] { 7 }; // Act objSMALL.switchMode(); objNullSMALL.switchMode(); int[] resultLARGE = objLARGE.filter(); int[] resultSMALL = objSMALL.filter(); int[] resultNullLARGE = objNullLARGE.filter(); int[] resultNullSMALL = objNullSMALL.filter(); // Assert CollectionAssert.AreEqual(resultLARGE, expectedLARGE); CollectionAssert.AreEqual(resultSMALL, expectedSMALL); CollectionAssert.AreEqual(resultNullLARGE, expectedNullLARGE); CollectionAssert.AreEqual(resultNullSMALL, expectedNullSMALL); }
public void Test_dataCut_FilterSmallMode() { // Arrange dataCut d = new dataCut(17); int[] testArray = new int[6] { 23, 28, 4, 20, 5, 58 }; int[] assertArray = new int[1] { 5 }; // Act d.scramble(testArray); int[] dFilter = d.filter(); // Assert CollectionAssert.AreEqual(dFilter, assertArray); }
public void Test_dataCut_FilterLargeMode() { // Arrange dataCut d = new dataCut(19); d.setMode(true); int[] testArray = new int[6] { 23, 28, 4, 20, 5, 58 }; int[] assertArray = new int[3] { 23, 28, 20 }; // Act d.scramble(testArray); int[] dFilter = d.filter(); // Assert CollectionAssert.AreEqual(dFilter, assertArray); }