예제 #1
0
        public async Task GetAllTest()
        {
            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.GetAllContests <ContestViewModel>();

            Assert.True(count == allContests.Count(), "GetAllTest method does not work correctly");
        }