public void ChangeStateTodoToDoneTimeTest() { var timeService = new TestTimeService { Time = new DateTime(2019, 10, 24, 22, 00, 00) }; var task = new TaskModel(timeService, 1, TaskStates.Todo, null, null); task.ChangeState(TaskStates.Done); Assert.AreEqual(TaskStates.Done, task.State); Assert.AreEqual(timeService.Time, task.Started); Assert.AreEqual(timeService.Time, task.Ended); }
public void ChangeStateInProgressToDoneWithDifferentTimeTest() { var timeService = new TestTimeService { Time = new DateTime(2019, 10, 24, 22, 00, 00) }; var startTime = new DateTime(2019, 10, 24, 21, 00, 00); var task = new TaskModel(timeService, 1, TaskStates.InProgress, startTime, null); task.ChangeState(TaskStates.Done); Assert.AreEqual(TaskStates.Done, task.State); Assert.AreEqual(startTime, task.Started); Assert.AreEqual(timeService.Time, task.Ended); }