@@ -15,32 +15,32 @@ namespace Tests;
1515
1616internal class FakeBackOffDelayPolicyDisabled : BackOffDelayPolicy
1717{
18- public int Delay ( )
18+ public new int Delay ( )
1919 {
2020 return 1 ;
2121 }
2222
23- public void Reset ( )
23+ public new void Reset ( )
2424 {
2525 }
2626
27- public bool IsActive ( ) => false ;
28- public int CurrentAttempt => 1 ;
27+ public new bool IsActive ( ) => false ;
28+ public new int CurrentAttempt => 1 ;
2929}
3030
3131internal class FakeFastBackOffDelay : BackOffDelayPolicy
3232{
33- public int Delay ( )
33+ public new int Delay ( )
3434 {
3535 return 200 ;
3636 }
3737
38- public void Reset ( )
38+ public new void Reset ( )
3939 {
4040 }
4141
42- public bool IsActive ( ) => true ;
43- public int CurrentAttempt => 1 ;
42+ public new bool IsActive ( ) => true ;
43+ public new int CurrentAttempt => 1 ;
4444}
4545
4646public class ConnectionRecoveryTests ( ITestOutputHelper testOutputHelper )
@@ -345,11 +345,13 @@ public async Task RecoveryTopologyShouldRecoverExchanges(bool topologyEnabled)
345345 Assert . Null ( _connection ) ;
346346 Assert . Null ( _management ) ;
347347
348+ var recoveryConfiguration = new RecoveryConfiguration ( ) ;
349+ recoveryConfiguration . BackOffDelayPolicy ( new FakeFastBackOffDelay ( ) ) ;
350+ recoveryConfiguration . Topology ( topologyEnabled ) ;
351+
348352 IConnection connection = await AmqpConnection . CreateAsync (
349353 ConnectionSettingBuilder . Create ( )
350- . RecoveryConfiguration ( RecoveryConfiguration . Create ( )
351- . BackOffDelayPolicy ( new FakeFastBackOffDelay ( ) )
352- . Topology ( topologyEnabled ) )
354+ . RecoveryConfiguration ( recoveryConfiguration )
353355 . ContainerId ( _containerId )
354356 . Build ( ) ) ;
355357 TaskCompletionSource < bool > twoRecoveryEventsSeenTcs = CreateTaskCompletionSource < bool > ( ) ;
@@ -403,11 +405,13 @@ public async Task RecoveryTopologyShouldRecoverBindings(bool topologyEnabled)
403405 Assert . Null ( _connection ) ;
404406 Assert . Null ( _management ) ;
405407
408+ var recoveryConfiguration = new RecoveryConfiguration ( ) ;
409+ recoveryConfiguration . BackOffDelayPolicy ( new FakeFastBackOffDelay ( ) ) ;
410+ recoveryConfiguration . Topology ( topologyEnabled ) ;
411+
406412 IConnection connection = await AmqpConnection . CreateAsync (
407413 ConnectionSettingBuilder . Create ( )
408- . RecoveryConfiguration ( RecoveryConfiguration . Create ( )
409- . BackOffDelayPolicy ( new FakeFastBackOffDelay ( ) )
410- . Topology ( topologyEnabled ) )
414+ . RecoveryConfiguration ( recoveryConfiguration )
411415 . ContainerId ( _containerId )
412416 . Build ( ) ) ;
413417 TaskCompletionSource < bool > twoRecoveryEventsSeenTcs = CreateTaskCompletionSource < bool > ( ) ;
@@ -486,11 +490,13 @@ public async Task RemoveAQueueShouldRemoveTheBindings()
486490
487491 string wontDeleteQueueName = _queueName + "-wont-delete" ;
488492
493+ var recoveryConfiguration = new RecoveryConfiguration ( ) ;
494+ recoveryConfiguration . BackOffDelayPolicy ( new FakeFastBackOffDelay ( ) ) ;
495+ recoveryConfiguration . Topology ( true ) ;
496+
489497 IConnection connection = await AmqpConnection . CreateAsync (
490498 ConnectionSettingBuilder . Create ( )
491- . RecoveryConfiguration ( RecoveryConfiguration . Create ( )
492- . BackOffDelayPolicy ( new FakeFastBackOffDelay ( ) )
493- . Topology ( true ) )
499+ . RecoveryConfiguration ( recoveryConfiguration )
494500 . ContainerId ( _containerId )
495501 . Build ( ) ) ;
496502
@@ -546,11 +552,13 @@ public async Task RemoveAnExchangeShouldRemoveTheBindings()
546552
547553 string wontDeleteExchangeName = _exchangeName + "-wont-delete" ;
548554
555+ var recoveryConfiguration = new RecoveryConfiguration ( ) ;
556+ recoveryConfiguration . BackOffDelayPolicy ( new FakeFastBackOffDelay ( ) ) ;
557+ recoveryConfiguration . Topology ( true ) ;
558+
549559 IConnection connection = await AmqpConnection . CreateAsync (
550560 ConnectionSettingBuilder . Create ( )
551- . RecoveryConfiguration ( RecoveryConfiguration . Create ( )
552- . BackOffDelayPolicy ( new FakeFastBackOffDelay ( ) )
553- . Topology ( true ) )
561+ . RecoveryConfiguration ( recoveryConfiguration )
554562 . ContainerId ( _containerId )
555563 . Build ( ) ) ;
556564
@@ -615,11 +623,13 @@ public async Task RemoveAnExchangeBoundToAnotherExchangeShouldRemoveTheBindings(
615623
616624 string destinationExchangeName = _exchangeName + "-destination" ;
617625
626+ var recoveryConfiguration = new RecoveryConfiguration ( ) ;
627+ recoveryConfiguration . BackOffDelayPolicy ( new FakeFastBackOffDelay ( ) ) ;
628+ recoveryConfiguration . Topology ( true ) ;
629+
618630 IConnection connection = await AmqpConnection . CreateAsync (
619631 ConnectionSettingBuilder . Create ( )
620- . RecoveryConfiguration ( RecoveryConfiguration . Create ( )
621- . BackOffDelayPolicy ( new FakeFastBackOffDelay ( ) )
622- . Topology ( true ) )
632+ . RecoveryConfiguration ( recoveryConfiguration )
623633 . ContainerId ( _containerId )
624634 . Build ( ) ) ;
625635
0 commit comments