コード例 #1
0
        public void Test_dataFilterQuirkyBeacon_ChargeFns()
        {
            // Arrange
            dataFilterQuirkyBeacon bc = new dataFilterQuirkyBeacon();

            int[] testArray        = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
            int[] signalArray      = new int[11];
            int[] signalArrayValid = new int[10];

            // Act
            bc.setSeq(testArray);
            for (int i = 0; i < signalArray.Length; i++)
            {
                signalArray[i] = bc.signal();
            }
            for (int i = 0; i < signalArrayValid.Length; i++)
            {
                signalArrayValid[i] = signalArray[i];
            }
            bc.recharge(5);

            // Assert
            Assert.AreEqual(bc.getCharge(), 5);
            Assert.AreEqual(signalArray[10], 0);
            CollectionAssert.DoesNotContain(signalArrayValid, 0);
        }
コード例 #2
0
        public void Test_dataFilterQuirkyBeacon_StateFns()
        {
            // Arrange
            dataFilterQuirkyBeacon bc = new dataFilterQuirkyBeacon();

            int[] testArray          = new int[] { 1, 2, 3, 4 };
            int[] signalArrayValid   = new int[4];
            int[] signalArrayInvalid = new int[4];

            // Act
            bc.setSeq(testArray);
            for (int i = 0; i < signalArrayValid.Length; i++)
            {
                signalArrayValid[i] = bc.signal();
            }
            for (int i = 0; i < 4; i++)
            {
                bc.turnOn();
            }
            for (int i = 0; i < signalArrayInvalid.Length; i++)
            {
                signalArrayInvalid[i] = bc.signal();
            }

            // Assert
            CollectionAssert.DoesNotContain(signalArrayValid, 0);
        }
コード例 #3
0
        public void Test_dataFilterQuirkyBeacon_SignalSetSeq()
        {
            // Arrange
            dataFilterQuirkyBeacon bc = new dataFilterQuirkyBeacon();

            int[] testArray   = new int[] { 1, 2, 3, 4, 5 };
            int[] signalArray = new int[5];

            // Act
            bc.setSeq(testArray);
            for (int i = 0; i < signalArray.Length; i++)
            {
                signalArray[i] = bc.signal();
            }

            // Assert
            CollectionAssert.DoesNotContain(signalArray, 0);
        }