Beispiel #1
0
        public async Task HasUserAdditionalInfoWithIdShouldReturnFalse()
        {
            var context = EssayCompetitionContextInMemoryFactory.InitializeContext();
            var user    = await this.seeder.SeedUserAsync(context, "*****@*****.**");

            var userAdditionalInfoRepository = new EfDeletableEntityRepository <UserAdditionalInfo>(context);
            var service = new UserAdditionalInfoService(userAdditionalInfoRepository);

            var result = service.HasUserAdditionalInfoWithId(user.Id);

            Assert.False(result, "HasUserAdditionalInfoWithId method does not work correctly");
        }
Beispiel #2
0
        public async Task GetUserWithIdAdditionalInfoTest()
        {
            var context = EssayCompetitionContextInMemoryFactory.InitializeContext();
            var user    = await this.seeder.SeedUserAsync(context, "*****@*****.**");

            var userAdditionalInfo = await this.seeder.SeedUserAdditionalInfo(context, user.Id, "#");

            var userAdditionalInfoRepository = new EfDeletableEntityRepository <UserAdditionalInfo>(context);
            var service = new UserAdditionalInfoService(userAdditionalInfoRepository);

            var result = service.GetUserWithIdAdditionalInfo <IndexViewModel>(user.Id);

            Assert.True(result.UserId == user.Id, "GetUserWithIdAdditionalInfo method does not work correctly");
        }