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>);
        }
        public async Task ExecuteAndReturn_ExecutePipelineAndPassCommandInContext()
        {
            var session = CreateSession();

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

            await session.ExecuteCommandAndReturn(command);

            CatchCommandPipelineStep.AssertCommandWithReturnContextCaptured <CommandMockReturn>(
                context => context.Command is CommandWithReturnMock actualCommand && actualCommand.Id == command.Id);
        }
        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);
        }