public void CommandReader_ViewTask_Good() { CommandReaderFake commandReader = new CommandReaderFake(); Command command = new Command(ActionEnum.View, "0"); string str = commandReader.viewTask(command); string strCmp = "Acheter du pain"; Assert.Equal(strCmp, str); }
public void CommandReader_CreateTask_Good() { CommandReaderFake commandReader = new CommandReaderFake(); Command command = new Command(ActionEnum.Create, "Acheter du pain"); Task task = commandReader.createTask(command); Task taskTest = new Task(0, "Acheter du pain"); Assert.True(taskTest.Equals(task)); }
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 }