public async Task Should_throw_security_exception_when_no_subject_or_client_is_found()
        {
            var command = new CreateContent();
            var context = Ctx(command);

            await Assert.ThrowsAsync <DomainForbiddenException>(() => sut.HandleAsync(context));
        }
Beispiel #2
0
        public async Task Should_throw_security_exception_when_no_subject_or_client_is_found()
        {
            var command = new CreateContent();
            var context = new CommandContext(command, commandBus);

            await Assert.ThrowsAsync <SecurityException>(() => sut.HandleAsync(context));
        }
        private async Task <CommandContext> HandleAsync(ICommand command)
        {
            var commandContext = new CommandContext(command, A.Fake <ICommandBus>());

            await sut.HandleAsync(commandContext);

            return(commandContext);
        }