Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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
        }