public void Test_CompleteTodo() { StateCalculationService calculationService = new StateCalculationService(); var @events = new List <BaseEvent>() { new TodoCompletedEvent() { Date = DateTime.Now.AddDays(-3) }, new TodoCompletedEvent() { Date = DateTime.Now.AddDays(-2) }, new TodoCompletedEvent() { Date = DateTime.Now.AddDays(-1) }, new TodoCompletedEvent() { Date = DateTime.Now.AddDays(0) }, new TodoCompletedEvent() { Date = DateTime.Now.AddDays(1) } }; var currentState = calculationService.Calculate(events, DateTime.Now); Assert.Equal(40, currentState.Points); }
public void Test_Login(IEnumerable <BaseEvent> events, UserState expectedState) { StateCalculationService calculationService = new StateCalculationService(); var currentState = calculationService.Calculate(events, DateTime.Now); Assert.Equal(expectedState, currentState, new UserStateComparer()); }