public void Test_dataModBeacon_ScrambleOddLengthSeq() { // Arrange dataModBeacon d = new dataModBeacon(); int[] testArray = new int[7] { 8, 24, 30, 31, 6, 11, 66 }; int[] assertArray = new int[7] { 8, 24, 2, 30, 2, 6, 66 }; // Act int[] dScramble = d.scramble(testArray); // Assert CollectionAssert.AreEqual(dScramble, assertArray); }
public void Test_dataModBeacon_ScrambleLargeMode() { // Arrange dataModBeacon d = new dataModBeacon(); d.setMode(true); int[] testArray = new int[6] { 8, 24, 30, 31, 6, 11 }; int[] assertArray = new int[6] { 24, 8, 30, 2, 6, 2 }; // Act int[] dScramble = d.scramble(testArray); // Assert CollectionAssert.AreEqual(dScramble, assertArray); }
public void Test_dataModBeacon_FilterSmallMode() { // Arrange dataModBeacon d = new dataModBeacon(13); int[] testArray = new int[6] { 8, 24, 30, 31, 6, 11 }; int[] assertArray = new int[4] { 7, 1, 5, 1 }; // Act d.scramble(testArray); // NOTE: All prime numbers will be replaced with '2' before updating int[] dFilter = d.filter(); // Assert CollectionAssert.AreEqual(dFilter, assertArray); }