Exemplo n.º 1
0
        public async Task GetAllInRangeTest()
        {
            var context = EssayCompetitionContextInMemoryFactory.InitializeContext();

            await this.SeedData(context);

            var contestRepository           = new EfDeletableEntityRepository <Contest>(context);
            var essayRepository             = new EfDeletableEntityRepository <Essay>(context);
            var essayTeacherRepository      = new EfDeletableEntityRepository <EssayTeacher>(context);
            var contestantContestRepository = new EfDeletableEntityRepository <ContestantContest>(context);
            var service = new ContestService(contestRepository, essayRepository, essayTeacherRepository, contestantContestRepository);

            var count              = service.GetContestsCount();
            var allContests        = service.GetAllContestsRange <ContestViewModel>(1, count - 1);
            var countGetCategories = allContests.Count();

            Assert.True(countGetCategories == count - 1, "GetAllInRangeTest method does not work correctly");
        }