public async Task Should_throw_exception_if_app_not_found()
        {
            appContext.App = null;

            var command = new CreateContent();
            var context = Ctx(command);

            await Assert.ThrowsAsync <InvalidOperationException>(() => sut.HandleAsync(context));
        }
        public async Task Should_throw_exception_if_app_not_found()
        {
            A.CallTo(() => contextProvider.Context)
            .Returns(Context.Anonymous(null !));

            var command = new CreateContent();
            var context = Ctx(command);

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

            await sut.HandleAsync(commandContext);

            return(commandContext);
        }
Esempio n. 4
0
        public async Task Should_throw_exception_if_app_not_found()
        {
            httpContext.Features.Set <IAppFeature>(new AppResolver.AppFeature(null));

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

            await Assert.ThrowsAsync <InvalidOperationException>(() => sut.HandleAsync(context));
        }