@@ -27,7 +27,7 @@ public async Task AddOperator_OperatorIsAdded()
2727 }
2828
2929 [ Fact ]
30- public async Task AddOperator_OperatorIsAdded_EventReplayHandled ( )
30+ public async Task AddOperator_EventReplayHandled ( )
3131 {
3232 Result result = await this . Repository . AddOperator ( TestData . DomainEvents . OperatorCreatedEvent , CancellationToken . None ) ;
3333 result . IsSuccess . ShouldBeTrue ( ) ;
@@ -46,7 +46,7 @@ public async Task AddContract_ContractIsAdded() {
4646 }
4747
4848 [ Fact ]
49- public async Task AddContract_ContractIsAdded_EventReplayHandled ( ) {
49+ public async Task AddContract_EventReplayHandled ( ) {
5050 Result result = await this . Repository . AddContract ( TestData . DomainEvents . ContractCreatedEvent , CancellationToken . None ) ;
5151 result . IsSuccess . ShouldBeTrue ( ) ;
5252
@@ -70,7 +70,7 @@ public async Task AddContractProduct_ContractProductIsAdded() {
7070 }
7171
7272 [ Fact ]
73- public async Task AddContractProduct_ContractProductIsAdded_EventReplayHandled ( ) {
73+ public async Task AddContractProduct_EventReplayHandled ( ) {
7474 Result result = await this . Repository . AddContractProduct ( TestData . DomainEvents . FixedValueProductAddedToContractEvent , CancellationToken . None ) ;
7575 result . IsSuccess . ShouldBeTrue ( ) ;
7676 EstateManagementContext context = this . GetContext ( ) ;
@@ -102,7 +102,7 @@ public async Task AddContractProductTransactionFee_ContractIsAdded()
102102 }
103103
104104 [ Fact ]
105- public async Task AddContractProductTransactionFee_ContractIsAdded_EventReplayHandled ( )
105+ public async Task AddContractProductTransactionFee_EventReplayHandled ( )
106106 {
107107 Result result = await this . Repository . AddContractProductTransactionFee ( TestData . DomainEvents . TransactionFeeForProductAddedToContractEvent , CancellationToken . None ) ;
108108 result . IsSuccess . ShouldBeTrue ( ) ;
@@ -122,7 +122,7 @@ public async Task AddFileImportLog_FileImportLogIsAdded()
122122 }
123123
124124 [ Fact ]
125- public async Task AddFileImportLog_FileImportLogIsAdded_EventReplayHandled ( )
125+ public async Task AddFileImportLog_EventReplayHandled ( )
126126 {
127127 Result result = await this . Repository . AddFileImportLog ( TestData . DomainEvents . ImportLogCreatedEvent , CancellationToken . None ) ;
128128 result . IsSuccess . ShouldBeTrue ( ) ;
@@ -150,5 +150,26 @@ public async Task AddFileImportLogFile_EventReplayHandled()
150150 result = await this . Repository . AddFileToImportLog ( TestData . DomainEvents . FileAddedToImportLogEvent , CancellationToken . None ) ;
151151 result . IsSuccess . ShouldBeTrue ( ) ;
152152 }
153+
154+
155+ [ Fact ]
156+ public async Task AddEstate_EstateIsAdded ( )
157+ {
158+ Result result = await this . Repository . AddEstate ( TestData . DomainEvents . EstateCreatedEvent , CancellationToken . None ) ;
159+ result . IsSuccess . ShouldBeTrue ( ) ;
160+ EstateManagementContext context = this . GetContext ( ) ;
161+ var estate = await context . Estates . SingleOrDefaultAsync ( f => f . EstateId == TestData . DomainEvents . EstateCreatedEvent . EstateId ) ;
162+ estate . ShouldNotBeNull ( ) ;
163+ }
164+
165+ [ Fact ]
166+ public async Task AddEstate_EventReplayHandled ( )
167+ {
168+ Result result = await this . Repository . AddEstate ( TestData . DomainEvents . EstateCreatedEvent , CancellationToken . None ) ;
169+ result . IsSuccess . ShouldBeTrue ( ) ;
170+
171+ result = await this . Repository . AddEstate ( TestData . DomainEvents . EstateCreatedEvent , CancellationToken . None ) ;
172+ result . IsSuccess . ShouldBeTrue ( ) ;
173+ }
153174 }
154175}
0 commit comments