Example #1
0
        public void Setup()
        {
            centresDataService = A.Fake <ICentresDataService>();
            clockService       = A.Fake <IClockService>();
            centresService     = new CentresService(centresDataService, clockService);

            A.CallTo(() => clockService.UtcNow).Returns(new DateTime(2021, 1, 1));
            A.CallTo(() => centresDataService.GetCentreRanks(A <DateTime> ._, A <int?> ._, 10, A <int> ._)).Returns(
                new[]
            {
                CentreTestHelper.GetCentreRank(1),
                CentreTestHelper.GetCentreRank(2),
                CentreTestHelper.GetCentreRank(3),
                CentreTestHelper.GetCentreRank(4),
                CentreTestHelper.GetCentreRank(5),
                CentreTestHelper.GetCentreRank(6),
                CentreTestHelper.GetCentreRank(7),
                CentreTestHelper.GetCentreRank(8),
                CentreTestHelper.GetCentreRank(9),
                CentreTestHelper.GetCentreRank(10),
            }
                );
        }
        public IEnumerable <CentreRanking> GetCentresForCentreRankingPage(int centreId, int numberOfDays, int?regionId)
        {
            var dateSince = clockService.UtcNow.AddDays(-numberOfDays);

            return(centresDataService.GetCentreRanks(dateSince, regionId, NumberOfCentresToDisplay, centreId).ToList());
        }