public async Task ExecuteAndReturn_ExecutePipelineAndPassHandlerInContext()
        {
            var session = CreateSession();

            var(command, _) = CommandWithReturnHandlerMock.GetCommand();

            await session.ExecuteCommandAndReturn(command);

            CatchCommandPipelineStep.AssertCommandWithReturnContextCaptured <CommandMockReturn>(
                context => context.Handler is CommandHandlerAdapter <ICommandHandler <HattemSessionMock, CommandWithReturnMock, CommandMockReturn>, HattemSessionMock, CommandWithReturnMock, CommandMockReturn>);
        }
Beispiel #2
0
        public async Task ExecuteAndReturn_ExecutePipelineAndPassCommandInContext()
        {
            var session = CreateSession();

            var(command, _) = StructCommandWithReturnHandlerMock.GetCommand();

            await session.ExecuteStructCommandAndReturn(command, Returns <CommandMockReturn> .Type);

            CatchCommandPipelineStep.AssertCommandWithReturnContextCaptured <StructCommandWithReturnMock, CommandMockReturn>(
                context => context.Command.Equals(command));
        }
        public async Task ExecuteAndReturn_ExecutePipelineAndPassConnectionInContext()
        {
            var session = CreateSession();

            var(command, _) = CommandWithReturnHandlerMock.GetCommand();

            await session.ExecuteCommandAndReturn(command);

            CatchCommandPipelineStep.AssertCommandWithReturnContextCaptured <CommandMockReturn>(
                // ReSharper disable once IsExpressionAlwaysTrue
                context => context.Connection is HattemSessionMock);
        }