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, _) = QueryHandlerMock.GetQuery(); await session.ProcessQuery(query); CatchQueryPipelineStep.AssertContextCaptured <QueryMockResult>( context => context.Query is QueryMock actualQuery && actualQuery.Id == query.Id); }
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); }