public void turnOnThreeTimesTest() { int turnedOnCount = 0; int[] testArray = new int[TEST_NUM] { 2, 4, 6, 8, 9, 10, 12, 14, 16, 18 }; Beacon testBeacon = new QuirkyBeacon(); string testOutput; testBeacon.giveSignalInput(testArray); for (int i = 0; i < FORCE_TURN_OFF; i++) { testOutput = testBeacon.emitSignal(); if (testOutput == "0") { testBeacon.turnOn(); testBeacon.recharge(); turnedOnCount++; if (turnedOnCount > TURN_OFFS_ALLOWED) { Assert.AreEqual("0", testOutput); } } } }
public void oddSignalTest() { int[] testArray = new int[TEST_NUM] { 2, 4, 6, 8, 9, 10, 12, 14, 16, 18 }; Beacon testBeacon = new QuirkyBeacon(); string testOutput; testBeacon.giveSignalInput(testArray); testOutput = testBeacon.emitSignal(); Assert.AreEqual("WuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuBWuB", testOutput); }