Esempio n. 1
0
        public void _03_Creer_une_classe_InProgressState_avec_une_methode_Start_et_Close()
        {
            Task task = new Task();

            InProgressState state = new InProgressState();

            Assert.Equal("INVALID TRANSITION", state.Start(task));
            Assert.Equal("IN PROGRESS -> CLOSED", state.Close(task));
        }
Esempio n. 2
0
        public void _05_Creer_une_interface_ITaskState_avec_une_methode_Start_et_Close_pour_unifier_TodoState_et_InProgressState_et_ClosedState()
        {
            Task task = new Task();

            ITaskState todoState = new TodoState();

            Assert.Equal("TODO -> IN PROGRESS", todoState.Start(task));
            Assert.Equal("INVALID TRANSITION", todoState.Close(task));

            ITaskState inProgressState = new InProgressState();

            Assert.Equal("INVALID TRANSITION", inProgressState.Start(task));
            Assert.Equal("IN PROGRESS -> CLOSED", inProgressState.Close(task));

            ITaskState closedState = new ClosedState();

            Assert.Equal("INVALID TRANSITION", closedState.Start(task));
            Assert.Equal("INVALID TRANSITION", closedState.Close(task));
        }