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); }
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); }