Example #1
0
        public async Task Test_TeamOverview_TotalSteps_AreCountedCorrectly()
        {
            var team = TestOverviewData.GetTeams().ToList();

            var stepsService = new StepsServiceStub(GetMockStepContext(team));
            var result       = await stepsService.GetTeamsOverview();

            var resultTotal   = result.Teams.ToList().First(r => r.TeamId == 1).TeamTotalSteps;
            var expectedTotal = 180;

            Assert.IsTrue(resultTotal == expectedTotal, $"Expected total steps to be: {expectedTotal} but got {resultTotal}");
        }
Example #2
0
        public async Task Test_TeamOverview_TotalSteps_TeamsWithLessPeopleGetAverageSteps()
        {
            var team = TestOverviewData.GetTeamWithThreePeople().ToList();

            var averageTeamSize = 4;
            var stepsService    = new StepsServiceStub(GetMockStepContext(team), averageTeamSize);
            var result          = await stepsService.GetTeamsOverview();

            var resultTotal   = result.Teams.ToList().First(r => r.TeamId == 1).TeamTotalStepsWithAverage;
            var expectedTotal = 240;

            Assert.IsTrue(resultTotal == expectedTotal, $"Expected total steps to be: {expectedTotal} but got {resultTotal}");
        }
Example #3
0
        public async Task Test_TeamOverview_TotalSteps_DoNotCountStepsOutsideOfDates(DateTime date)
        {
            var team = TestOverviewData.GetTeams().ToList();

            team.First(r => r.TeamId == 1).Participants.First(p => p.ParticipantId == 11).Steps.Add(new Steps
            {
                StepCount   = 30,
                DateOfSteps = date,
            });

            var stepsService = new StepsServiceStub(GetMockStepContext(team));
            var result       = await stepsService.GetTeamsOverview();

            var resultTotal   = result.Teams.ToList().First(r => r.TeamId == 1).TeamTotalSteps;
            var expectedTotal = 180;

            Assert.IsTrue(resultTotal == expectedTotal, $"Expected total steps to be: {expectedTotal} but got {resultTotal}");
        }