public void ConsoleWrite_Write_Console() { string str = "test"; ConsoleWriterMock consoleWriter = new ConsoleWriterMock(); consoleWriter.write(str); Assert.Equal(1, consoleWriter.WriteIsCalled); }
public void Acceptance_Test_Task_Created() { string cmd = "tasks create \"Acheter du pain\""; InputReaderFake inputReaderFake = new InputReaderFake(); Command command = inputReaderFake.readInput(cmd); CommandReaderFake commandReader = new CommandReaderFake(); Task task = commandReader.createTask(command); String str = task.getId(); ConsoleWriterMock consoleWriter = new ConsoleWriterMock(); consoleWriter.write(str); Assert.Equal(1, consoleWriter.WriteIsCalled); }
public void Acceptance_Test_Task_Viewed() { string cmd = "tasks view 0"; InputReaderFake inputReaderFake = new InputReaderFake(); Command command = inputReaderFake.readInput(cmd); CommandReaderFake commandReaderFake = new CommandReaderFake(); string str = commandReaderFake.viewTask(command); ConsoleWriterMock consoleWriter = new ConsoleWriterMock(); Assert.Equal("Acheter du pain", str); //consoleWriter.write(str); //Assert.Equal(1, consoleWriter.WriteIsCalled); // I m not convinced by this final test yet // Acceptance TEst pass & unit test doesn't pass bad, very baddd }