Exemple #1
0
        public async Task Should_do_nothing_when_context_is_null()
        {
            A.CallTo(() => httpContextAccessor.HttpContext)
            .Returns(null);

            var command = new CreateContent();
            var context = new CommandContext(command, commandBus);

            await sut.HandleAsync(context);

            Assert.Null(command.Actor);
        }
Exemple #2
0
        private async Task <CommandContext> HandleAsync(ICommand command, object result)
        {
            var commandContext = new CommandContext(command, A.Fake <ICommandBus>()).Complete(result);

            await sut.HandleAsync(commandContext);

            return(commandContext);
        }