public void MachineController_UnreadableNumberCorrectChecksum_WritesLogWithILL() { string input = " _ _ _ _ _ _ _ " + " | _| _||_||_ |_ _||_||_|" + " ||_ _| | _||_| ||_| _|"; var sut = new Controller(input, new Scanner(), new ChecksumCalculator()); sut.ProcessInput(); Assert.AreEqual(sut.log.ElementAt(0), "123456?89 ILL"); }
public void MachineController_WrongChecksum_WritesLogWithERR() { string input = " _ _ _ _ _ _ _ _ _ " + "| ||_ ||_ | ||_|| || || |" + "|_| _| | _||_||_||_||_||_|"; var sut = new Controller(input, new Scanner(), new ChecksumCalculator()); sut.ProcessInput(); Assert.AreEqual(sut.log.ElementAt(0), "057508000 ERR"); }
public void MachineController_EverythingCorrect_WritesLog() { string input = " _ _ _ _ _ _ _ " + " | _| _||_||_ |_ ||_||_|" + " ||_ _| | _||_| ||_| _|"; var sut = new Controller(input, new Scanner(), new ChecksumCalculator()); sut.ProcessInput(); Assert.AreEqual(sut.log.ElementAt(0), "123456789"); }