11namespace TransactionProcessor . ProjectionEngine . Tests ;
22
33using Dispatchers ;
4+ using Microsoft . Extensions . Configuration ;
45using Moq ;
56using Projections ;
67using Repository ;
78using Shared . DomainDrivenDesign . EventSourcing ;
9+ using Shared . General ;
810using Shouldly ;
911using State ;
1012
1113public class ProjectionHandlerTests {
1214
15+ public ProjectionHandlerTests ( ) {
16+ Shared . Logger . Logger . Initialise ( Shared . Logger . NullLogger . Instance ) ;
17+ IConfigurationRoot configurationRoot = new ConfigurationBuilder ( ) . AddInMemoryCollection ( TestData . DefaultAppSettings ) . Build ( ) ;
18+ ConfigurationReader . Initialise ( configurationRoot ) ;
19+ }
20+
1321 [ Fact ]
1422 public async Task ProjectionHandler_Handle_NullEvent_EventHandled ( ) {
1523 Mock < IProjectionStateRepository < MerchantBalanceState > > repo = new Mock < IProjectionStateRepository < MerchantBalanceState > > ( ) ;
@@ -57,8 +65,6 @@ public async Task ProjectionHandler_Handle_StateNotFoundInRepository_EventHandle
5765 [ Fact ]
5866 public async Task ProjectionHandler_Handle_StateFoundInRepository_NoChanges_EventHandled ( )
5967 {
60- Shared . Logger . Logger . Initialise ( Shared . Logger . NullLogger . Instance ) ;
61-
6268 Mock < IProjectionStateRepository < MerchantBalanceState > > repo = new Mock < IProjectionStateRepository < MerchantBalanceState > > ( ) ;
6369 Mock < IProjection < MerchantBalanceState > > projection = new Mock < IProjection < MerchantBalanceState > > ( ) ;
6470 Mock < IStateDispatcher < MerchantBalanceState > > stateDispatcher = new Mock < IStateDispatcher < MerchantBalanceState > > ( ) ;
@@ -80,8 +86,6 @@ public async Task ProjectionHandler_Handle_StateFoundInRepository_NoChanges_Even
8086 [ Fact ]
8187 public async Task ProjectionHandler_Handle_StateFoundInRepository_ChangesMade_EventHandled ( )
8288 {
83- Shared . Logger . Logger . Initialise ( Shared . Logger . NullLogger . Instance ) ;
84-
8589 Mock < IProjectionStateRepository < MerchantBalanceState > > repo = new Mock < IProjectionStateRepository < MerchantBalanceState > > ( ) ;
8690 Mock < IProjection < MerchantBalanceState > > projection = new Mock < IProjection < MerchantBalanceState > > ( ) ;
8791 Mock < IStateDispatcher < MerchantBalanceState > > stateDispatcher = new Mock < IStateDispatcher < MerchantBalanceState > > ( ) ;
0 commit comments