Example #1
0
        public void isOnCorrectlyWorkingTest()
        {
            Beacon testBeacon = new Beacon();

            int[] testArray = new int[TEST_NUM] {
                2, 4, 6, 8, 10, 12, 14, 16, 18, 20
            };
            testBeacon.giveSignalInput(testArray);
            testBeacon.turnOn();
            Assert.AreEqual(testBeacon.emitSignal(), "0");

            testBeacon.turnOn();
            Assert.AreEqual(testBeacon.emitSignal(), "WuBWuBWuBWuBWuBWuBWuBWuBWuBWuB");
        }
Example #2
0
        public void onAndNotChargedTest()
        {
            Beacon testBeacon = new Beacon();

            int[] testArray = new int[TEST_NUM] {
                2, 4, 6, 8, 10, 12, 14, 16, 18, 20
            };
            string signal;

            for (int i = 0; i < TEST_NUM; i++)
            {
                testBeacon.giveSignalInput(testArray);
                signal = testBeacon.emitSignal();
            }

            testBeacon.turnOn();

            Assert.AreEqual(testBeacon.emitSignal(), "-1");
        }
Example #3
0
 // Pre: None
 // Post: Beacon may be turned on.
 public void beaconTurnOn()
 {
     BComposite.turnOn();
 }