Ejemplo n.º 1
0
        public void dataCutQuirkyBeaconScramble()
        {
            int[] testArray1 = new int[SEQUENCE_SIZE_TEST_NUM] {
                419, 2003, 11764, 8000, 912, 1000, 45, 13227, 6636, 952
            };
            int[] testArray2 = new int[SEQUENCE_SIZE_TEST_NUM] {
                18520, 17, -4045, 1608, -250, -16874, 7113, -3987, -21, 500
            };
            int[] testArray3 = new int[SEQUENCE_SIZE_TEST_NUM] {
                419, 88, 25, 11764, 912, 952, 5, 6, 7, 999
            };
            int[] testArray4 = new int[SEQUENCE_SIZE_TEST_NUM] {
                18520, -250, -16874, 21, -21, 75, 76, 115, 116, 224
            };

            dataFilterBeaconComposition test1 = new dataFilterBeaconComposition(dataCutOrQuirkyBeacon, dataCutOrQuirkyBeacon, dataFilterLargeMode);
            dataFilterBeaconComposition test2 = new dataFilterBeaconComposition(dataCutOrQuirkyBeacon, dataCutOrQuirkyBeacon, !dataFilterLargeMode);

            string expectedLarge = "WuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuB";
            string expectedSmall = "WuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuB";

            test1.EmitScrambledSignal(testArray1);
            test2.EmitScrambledSignal(testArray2);

            string actualLarge = test1.EmitScrambledSignal(testArray3);
            string actualSmall = test2.EmitScrambledSignal(testArray4);

            Assert.AreEqual(expectedLarge, actualLarge);
            Assert.AreEqual(expectedSmall, actualSmall);
        }
Ejemplo n.º 2
0
        public void dataFilterQuirkyBeaconSignal()
        {
            int[] testArray1 = new int[SEQUENCE_SIZE_TEST_NUM] {
                419, 2003, 11764, 8000, 912, 1000, 45, 13227, 6636, 952
            };
            int[] testArray2 = new int[SEQUENCE_SIZE_TEST_NUM] {
                18520, 17, -4045, 1608, -250, -16874, 7113, -3987, -21, 500
            };

            dataFilterBeaconComposition test1 = new dataFilterBeaconComposition(dataFilterOrBeacon, dataCutOrQuirkyBeacon, dataFilterLargeMode);
            dataFilterBeaconComposition test2 = new dataFilterBeaconComposition(dataFilterOrBeacon, dataCutOrQuirkyBeacon, !dataFilterLargeMode);

            string expectedLarge = "";
            string expectedSmall = "";

            for (int i = 0; i < 48; i++)
            {
                expectedSmall += "WuB";
            }

            string actualLarge = test1.EmitScrambledSignal(testArray1);
            string actualSmall = test2.EmitScrambledSignal(testArray2);

            Assert.AreEqual(expectedLarge, actualLarge);
            Assert.AreEqual(expectedSmall, actualSmall);
        }
Ejemplo n.º 3
0
        public void dataModStrobeBeaconScramble()
        {
            int[] testArray1 = new int[SEQUENCE_SIZE_TEST_NUM] {
                419, 2003, 11764, 8000, 912, 1000, 45, 13227, 6636, 952
            };
            int[] testArray2 = new int[SEQUENCE_SIZE_TEST_NUM] {
                419, 2003, 11764, 8000, 912, 1000, 45, 13227, 6636, 952
            };

            dataFilterBeaconComposition test1 = new dataFilterBeaconComposition(dataModOrStrobeBeacon, dataModOrStrobeBeacon, dataFilterLargeMode);
            dataFilterBeaconComposition test2 = new dataFilterBeaconComposition(dataModOrStrobeBeacon, dataModOrStrobeBeacon, !dataFilterLargeMode);

            string expectedLarge = "WuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuB";
            string expectedSmall = "WuBWuBWuBWuBWuBWuB";

            string actualLarge = test1.EmitScrambledSignal(testArray1);

            test2.EmitScrambledSignal(testArray2);
            string actualSmall = test2.EmitScrambledSignal(testArray2);

            Assert.AreEqual(expectedLarge, actualLarge);
            Assert.AreEqual(expectedSmall, actualSmall);
        }