@@ -89,23 +89,25 @@ public async Task GivenAFileStorageMetadata_WhenQueueingWihtoutSpecifyingATimeou
89
89
}
90
90
91
91
[ RetryFact ]
92
- public async Task GivenFileStorageMetadataInTheDatabase_AtServiceStartup_ExpectFileStorageMetadataToBeRestoredFromTheDatabase ( )
92
+ public async Task GivenFileStorageMetadataInTheDatabase_AtServiceStartup_ExpectPayloadsInCreatedStateToBeRemoved ( )
93
93
{
94
94
var dataset = new List < Payload >
95
95
{
96
- new Payload ( "created-test" , Guid . NewGuid ( ) . ToString ( ) , 10 ) { State = Payload . PayloadState . Created } ,
96
+ new Payload ( "created-test1" , Guid . NewGuid ( ) . ToString ( ) , 10 ) { State = Payload . PayloadState . Created } ,
97
+ new Payload ( "created-test2" , Guid . NewGuid ( ) . ToString ( ) , 10 ) { State = Payload . PayloadState . Created } ,
97
98
new Payload ( "upload-test" , Guid . NewGuid ( ) . ToString ( ) , 10 ) { State = Payload . PayloadState . Move } ,
98
99
new Payload ( "notify-test" , Guid . NewGuid ( ) . ToString ( ) , 10 ) { State = Payload . PayloadState . Notify } ,
99
100
} ;
100
101
101
102
_repository . Setup ( p => p . AsQueryable ( ) ) . Returns ( dataset . AsQueryable ( ) ) ;
103
+ _repository . Setup ( p => p . Remove ( It . IsAny < Payload > ( ) ) ) ;
104
+
102
105
var payloadAssembler = new PayloadAssembler ( _options , _logger . Object , _serviceScopeFactory . Object ) ;
103
106
await Task . Delay ( 250 ) ;
104
107
payloadAssembler . Dispose ( ) ;
105
108
_cancellationTokenSource . Cancel ( ) ;
106
109
107
- _logger . VerifyLogging ( $ "Restoring payloads from database.", LogLevel . Information , Times . Once ( ) ) ;
108
- _logger . VerifyLogging ( $ "1 payloads restored from database.", LogLevel . Information , Times . Once ( ) ) ;
110
+ _repository . Verify ( p => p . Remove ( It . IsAny < Payload > ( ) ) , Times . Exactly ( 2 ) ) ;
109
111
}
110
112
111
113
[ RetryFact ]
0 commit comments