@@ -55,47 +55,41 @@ public async Task AddContract_ContractIsAdded_EventReplayHandled() {
5555 }
5656
5757 [ Fact ]
58- public async Task AddContractProduct_ContractProductIsAdded ( )
59- {
58+ public async Task AddContractProduct_ContractProductIsAdded ( ) {
6059 Result result = await this . Repository . AddContractProduct ( TestData . DomainEvents . FixedValueProductAddedToContractEvent , CancellationToken . None ) ;
6160 result . IsSuccess . ShouldBeTrue ( ) ;
6261 EstateManagementContext context = this . GetContext ( ) ;
63- ContractProduct ? fixedContractProduct = await context . ContractProducts . SingleOrDefaultAsync ( c => c . ContractId == TestData . DomainEvents . FixedValueProductAddedToContractEvent . ContractId &&
64- c . ContractProductId == TestData . DomainEvents . FixedValueProductAddedToContractEvent . ProductId ) ;
62+ ContractProduct ? fixedContractProduct = await context . ContractProducts . SingleOrDefaultAsync ( c => c . ContractId == TestData . DomainEvents . FixedValueProductAddedToContractEvent . ContractId && c . ContractProductId == TestData . DomainEvents . FixedValueProductAddedToContractEvent . ProductId ) ;
6563 fixedContractProduct . ShouldNotBeNull ( ) ;
6664
6765 result = await this . Repository . AddContractProduct ( TestData . DomainEvents . VariableValueProductAddedToContractEvent , CancellationToken . None ) ;
6866 result . IsSuccess . ShouldBeTrue ( ) ;
6967 context = this . GetContext ( ) ;
70- ContractProduct ? variableContractProduct = await context . ContractProducts . SingleOrDefaultAsync ( c => c . ContractId == TestData . DomainEvents . VariableValueProductAddedToContractEvent . ContractId &&
71- c . ContractProductId == TestData . DomainEvents . VariableValueProductAddedToContractEvent . ProductId ) ;
68+ ContractProduct ? variableContractProduct = await context . ContractProducts . SingleOrDefaultAsync ( c => c . ContractId == TestData . DomainEvents . VariableValueProductAddedToContractEvent . ContractId && c . ContractProductId == TestData . DomainEvents . VariableValueProductAddedToContractEvent . ProductId ) ;
7269 variableContractProduct . ShouldNotBeNull ( ) ;
7370 }
7471
7572 [ Fact ]
76- public async Task AddContractProduct_ContractProductIsAdded_EventReplayHandled ( )
77- {
73+ public async Task AddContractProduct_ContractProductIsAdded_EventReplayHandled ( ) {
7874 Result result = await this . Repository . AddContractProduct ( TestData . DomainEvents . FixedValueProductAddedToContractEvent , CancellationToken . None ) ;
7975 result . IsSuccess . ShouldBeTrue ( ) ;
8076 EstateManagementContext context = this . GetContext ( ) ;
81- ContractProduct ? fixedContractProduct = await context . ContractProducts . SingleOrDefaultAsync ( c => c . ContractId == TestData . DomainEvents . FixedValueProductAddedToContractEvent . ContractId &&
82- c . ContractProductId == TestData . DomainEvents . FixedValueProductAddedToContractEvent . ProductId ) ;
77+ ContractProduct ? fixedContractProduct = await context . ContractProducts . SingleOrDefaultAsync ( c => c . ContractId == TestData . DomainEvents . FixedValueProductAddedToContractEvent . ContractId && c . ContractProductId == TestData . DomainEvents . FixedValueProductAddedToContractEvent . ProductId ) ;
8378 fixedContractProduct . ShouldNotBeNull ( ) ;
8479
8580 result = await this . Repository . AddContractProduct ( TestData . DomainEvents . VariableValueProductAddedToContractEvent , CancellationToken . None ) ;
8681 result . IsSuccess . ShouldBeTrue ( ) ;
8782 context = this . GetContext ( ) ;
88- ContractProduct ? variableContractProduct = await context . ContractProducts . SingleOrDefaultAsync ( c => c . ContractId == TestData . DomainEvents . VariableValueProductAddedToContractEvent . ContractId &&
89- c . ContractProductId == TestData . DomainEvents . VariableValueProductAddedToContractEvent . ProductId ) ;
83+ ContractProduct ? variableContractProduct = await context . ContractProducts . SingleOrDefaultAsync ( c => c . ContractId == TestData . DomainEvents . VariableValueProductAddedToContractEvent . ContractId && c . ContractProductId == TestData . DomainEvents . VariableValueProductAddedToContractEvent . ProductId ) ;
9084 variableContractProduct . ShouldNotBeNull ( ) ;
9185
9286 result = await this . Repository . AddContractProduct ( TestData . DomainEvents . FixedValueProductAddedToContractEvent , CancellationToken . None ) ;
9387 result . IsSuccess . ShouldBeTrue ( ) ;
94-
88+
9589 result = await this . Repository . AddContractProduct ( TestData . DomainEvents . VariableValueProductAddedToContractEvent , CancellationToken . None ) ;
9690 result . IsSuccess . ShouldBeTrue ( ) ;
9791 }
98-
92+
9993 [ Fact ]
10094 public async Task AddContractProductTransactionFee_ContractIsAdded ( )
10195 {
@@ -116,5 +110,25 @@ public async Task AddContractProductTransactionFee_ContractIsAdded_EventReplayHa
116110 result = await this . Repository . AddContractProductTransactionFee ( TestData . DomainEvents . TransactionFeeForProductAddedToContractEvent , CancellationToken . None ) ;
117111 result . IsSuccess . ShouldBeTrue ( ) ;
118112 }
119- }
113+
114+ [ Fact ]
115+ public async Task AddFileImportLog_FileImportLogIsAdded ( )
116+ {
117+ Result result = await this . Repository . AddFileImportLog ( TestData . DomainEvents . ImportLogCreatedEvent , CancellationToken . None ) ;
118+ result . IsSuccess . ShouldBeTrue ( ) ;
119+ EstateManagementContext context = this . GetContext ( ) ;
120+ var fileImportLog = await context . FileImportLogs . SingleOrDefaultAsync ( f => f . FileImportLogId == TestData . DomainEvents . ImportLogCreatedEvent . FileImportLogId ) ;
121+ fileImportLog . ShouldNotBeNull ( ) ;
122+ }
123+
124+ [ Fact ]
125+ public async Task AddFileImportLog_FileImportLogIsAdded_EventReplayHandled ( )
126+ {
127+ Result result = await this . Repository . AddFileImportLog ( TestData . DomainEvents . ImportLogCreatedEvent , CancellationToken . None ) ;
128+ result . IsSuccess . ShouldBeTrue ( ) ;
129+
130+ result = await this . Repository . AddFileImportLog ( TestData . DomainEvents . ImportLogCreatedEvent , CancellationToken . None ) ;
131+ result . IsSuccess . ShouldBeTrue ( ) ;
132+ }
133+ }
120134}
0 commit comments