public void InputReader_ReadInput_Create_Good() { string cmd = "tasks create \"Acheter du pain\""; InputReaderFake inputReaderFake = new InputReaderFake(); Command command = inputReaderFake.readInput(cmd); Command commandTest = new Command(ActionEnum.Create, "Acheter du pain"); Assert.Equal(commandTest, command); }
public void InputReader_ReadInput_View_Good() { string cmd = "tasks view 0"; InputReaderFake inputReaderFake = new InputReaderFake(); Command command = inputReaderFake.readInput(cmd); Command commandTest = new Command(ActionEnum.View, "0"); Assert.Equal(commandTest, command); }
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 }