Beispiel #1
0
        public async Task CreateRoleAsyncTest()
        {
            var context       = EssayCompetitionContextInMemoryFactory.InitializeContext();
            var roleName      = "Ninja";
            var roleViewModel = new CreateViewModel()
            {
                Name = roleName
            };
            var roleRepository = new EfDeletableEntityRepository <ApplicationRole>(context);
            var service        = new RolesService(roleRepository);

            await service.CreateRoleAsync <CreateViewModel>(roleViewModel.ToQueryable());

            Assert.True(roleRepository.All().Any(x => x.Name == roleName), "CreateRoleAsync method does not work correctly");
        }