// Write digits into a file and returns the file path private string WriteFile(string input) { using (var outputController = new FileOutput()) { var service = new LcdWriterService(input, 0, _factory, outputController); service.Write(); return(outputController.TestFilePath);; } }
public void WhenNotStartingAtTopItJumpsALine() { var outputMock = new Mock <IOutputController>(); var service = new LcdWriterService("1", 1, _factory, outputMock.Object); service.Write(); outputMock.Verify(m => m.WriteLine(), Times.Once); }
public void ShouldAlwaysWriteNineTimes() { var outputMock = new Mock <IOutputController>(); var randomNumber = new Random().Next(0, 10); var service = new LcdWriterService($"{randomNumber}", 0, _factory, outputMock.Object); service.Write(); outputMock.Verify(m => m.Write(It.IsAny <char>()), Times.Exactly(9)); }