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>); }
public async Task Process_ExecutePipelineAndPassQueryInContext() { var session = CreateSession(); var(query, _) = StructQueryHandlerMock.GetQuery(); await session.ProcessStructQuery(query, Returns <QueryMockResult> .Type); CatchQueryPipelineStep.AssertContextCaptured <StructQueryMock, QueryMockResult>( context => context.Query.Equals(query)); }
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); }