Exemplo n.º 1
0
        public async Task Process_ExecutePipelineAndPassHandlerInContext()
        {
            var session = CreateSession();

            var(query, _) = QueryHandlerMock.GetQuery();

            await session.ProcessQuery(query);

            CatchQueryPipelineStep.AssertContextCaptured <QueryMockResult>(
                context => context.Handler is QueryHandlerAdapter <IQueryHandler <HattemSessionMock, QueryMock, QueryMockResult>, HattemSessionMock, QueryMock, QueryMockResult>);
        }
Exemplo n.º 2
0
        public async Task Process_ExecutePipelineAndPassQueryInContext()
        {
            var session = CreateSession();

            var(query, _) = QueryHandlerMock.GetQuery();

            await session.ProcessQuery(query);

            CatchQueryPipelineStep.AssertContextCaptured <QueryMockResult>(
                context => context.Query is QueryMock actualQuery && actualQuery.Id == query.Id);
        }
Exemplo n.º 3
0
        public async Task Process_ExecutePipelineAndPassConnectionInContext()
        {
            var session = CreateSession();

            var(query, _) = QueryHandlerMock.GetQuery();

            await session.ProcessQuery(query);

            CatchQueryPipelineStep.AssertContextCaptured <QueryMockResult>(
                // ReSharper disable once IsExpressionAlwaysTrue
                context => context.Connection is HattemSessionMock);
        }