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