Пример #1
0
        public async Task <ActionResult <bool> > Remove(string resource)
        {
            var model = new RemoveIdentityResourceViewModel(resource);
            await _identityResourceAppService.Remove(model);

            return(ResponseDelete());
        }
        public async Task <ActionResult <DefaultResponse <bool> > > Remove([FromBody] RemoveIdentityResourceViewModel model)
        {
            if (!ModelState.IsValid)
            {
                NotifyModelStateErrors();
                return(Response(false));
            }
            await _identityResourceAppService.Remove(model);

            return(Response(true));
        }
        public async Task ShouldRemoveIdentityResource()
        {
            var command = IdentityResourceFaker.GenerateIdentiyResource().Generate();

            await _identityResource.Save(command);

            _database.IdentityResources.FirstOrDefault(s => s.Name == command.Name).Should().NotBeNull();

            await _identityResource.Remove(new RemoveIdentityResourceViewModel(command.Name));

            _notifications.GetNotifications().Select(s => s.Value).ToList().ForEach(_output.WriteLine);
            _database.IdentityResources.FirstOrDefault(s => s.Name == command.Name).Should().BeNull();
        }