public void OscillateHighTest() { int[] testArray = new int[TEST_NUM] { 2, 4, 6, 8, 9, 10, 12, 14, 16, 18 }; Beacon testBeacon = new StrobeBeacon(); testBeacon.giveSignalInput(testArray); string testOutput = testBeacon.emitSignal(); Assert.AreEqual("WuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuB", testOutput); }
public void turnedOffAfterChargeDepletedTest() { int[] testArray = new int[TEST_NUM] { 2, 4, 6, 8, 9, 10, 12, 14, 16, 18 }; Beacon testBeacon = new StrobeBeacon(); testBeacon.giveSignalInput(testArray); for (int i = 0; i < TEST_NUM; i++) { testBeacon.emitSignal(); } Assert.AreEqual("0", testBeacon.emitSignal()); }
public void noRechargeTest() { int[] testArray = new int[TEST_NUM] { 2, 4, 6, 8, 9, 10, 12, 14, 16, 18 }; Beacon testBeacon = new StrobeBeacon(); testBeacon.giveSignalInput(testArray); for (int i = 0; i < TEST_NUM; i++) { testBeacon.emitSignal(); } testBeacon.turnOn(); testBeacon.recharge(); string testOutput = testBeacon.emitSignal(); Assert.AreEqual("-1", testOutput); }