@@ -15,32 +15,32 @@ namespace Tests;
15
15
16
16
internal class FakeBackOffDelayPolicyDisabled : BackOffDelayPolicy
17
17
{
18
- public int Delay ( )
18
+ public new int Delay ( )
19
19
{
20
20
return 1 ;
21
21
}
22
22
23
- public void Reset ( )
23
+ public new void Reset ( )
24
24
{
25
25
}
26
26
27
- public bool IsActive ( ) => false ;
28
- public int CurrentAttempt => 1 ;
27
+ public new bool IsActive ( ) => false ;
28
+ public new int CurrentAttempt => 1 ;
29
29
}
30
30
31
31
internal class FakeFastBackOffDelay : BackOffDelayPolicy
32
32
{
33
- public int Delay ( )
33
+ public new int Delay ( )
34
34
{
35
35
return 200 ;
36
36
}
37
37
38
- public void Reset ( )
38
+ public new void Reset ( )
39
39
{
40
40
}
41
41
42
- public bool IsActive ( ) => true ;
43
- public int CurrentAttempt => 1 ;
42
+ public new bool IsActive ( ) => true ;
43
+ public new int CurrentAttempt => 1 ;
44
44
}
45
45
46
46
public class ConnectionRecoveryTests ( ITestOutputHelper testOutputHelper )
@@ -345,11 +345,13 @@ public async Task RecoveryTopologyShouldRecoverExchanges(bool topologyEnabled)
345
345
Assert . Null ( _connection ) ;
346
346
Assert . Null ( _management ) ;
347
347
348
+ var recoveryConfiguration = new RecoveryConfiguration ( ) ;
349
+ recoveryConfiguration . BackOffDelayPolicy ( new FakeFastBackOffDelay ( ) ) ;
350
+ recoveryConfiguration . Topology ( topologyEnabled ) ;
351
+
348
352
IConnection connection = await AmqpConnection . CreateAsync (
349
353
ConnectionSettingBuilder . Create ( )
350
- . RecoveryConfiguration ( RecoveryConfiguration . Create ( )
351
- . BackOffDelayPolicy ( new FakeFastBackOffDelay ( ) )
352
- . Topology ( topologyEnabled ) )
354
+ . RecoveryConfiguration ( recoveryConfiguration )
353
355
. ContainerId ( _containerId )
354
356
. Build ( ) ) ;
355
357
TaskCompletionSource < bool > twoRecoveryEventsSeenTcs = CreateTaskCompletionSource < bool > ( ) ;
@@ -403,11 +405,13 @@ public async Task RecoveryTopologyShouldRecoverBindings(bool topologyEnabled)
403
405
Assert . Null ( _connection ) ;
404
406
Assert . Null ( _management ) ;
405
407
408
+ var recoveryConfiguration = new RecoveryConfiguration ( ) ;
409
+ recoveryConfiguration . BackOffDelayPolicy ( new FakeFastBackOffDelay ( ) ) ;
410
+ recoveryConfiguration . Topology ( topologyEnabled ) ;
411
+
406
412
IConnection connection = await AmqpConnection . CreateAsync (
407
413
ConnectionSettingBuilder . Create ( )
408
- . RecoveryConfiguration ( RecoveryConfiguration . Create ( )
409
- . BackOffDelayPolicy ( new FakeFastBackOffDelay ( ) )
410
- . Topology ( topologyEnabled ) )
414
+ . RecoveryConfiguration ( recoveryConfiguration )
411
415
. ContainerId ( _containerId )
412
416
. Build ( ) ) ;
413
417
TaskCompletionSource < bool > twoRecoveryEventsSeenTcs = CreateTaskCompletionSource < bool > ( ) ;
@@ -486,11 +490,13 @@ public async Task RemoveAQueueShouldRemoveTheBindings()
486
490
487
491
string wontDeleteQueueName = _queueName + "-wont-delete" ;
488
492
493
+ var recoveryConfiguration = new RecoveryConfiguration ( ) ;
494
+ recoveryConfiguration . BackOffDelayPolicy ( new FakeFastBackOffDelay ( ) ) ;
495
+ recoveryConfiguration . Topology ( true ) ;
496
+
489
497
IConnection connection = await AmqpConnection . CreateAsync (
490
498
ConnectionSettingBuilder . Create ( )
491
- . RecoveryConfiguration ( RecoveryConfiguration . Create ( )
492
- . BackOffDelayPolicy ( new FakeFastBackOffDelay ( ) )
493
- . Topology ( true ) )
499
+ . RecoveryConfiguration ( recoveryConfiguration )
494
500
. ContainerId ( _containerId )
495
501
. Build ( ) ) ;
496
502
@@ -546,11 +552,13 @@ public async Task RemoveAnExchangeShouldRemoveTheBindings()
546
552
547
553
string wontDeleteExchangeName = _exchangeName + "-wont-delete" ;
548
554
555
+ var recoveryConfiguration = new RecoveryConfiguration ( ) ;
556
+ recoveryConfiguration . BackOffDelayPolicy ( new FakeFastBackOffDelay ( ) ) ;
557
+ recoveryConfiguration . Topology ( true ) ;
558
+
549
559
IConnection connection = await AmqpConnection . CreateAsync (
550
560
ConnectionSettingBuilder . Create ( )
551
- . RecoveryConfiguration ( RecoveryConfiguration . Create ( )
552
- . BackOffDelayPolicy ( new FakeFastBackOffDelay ( ) )
553
- . Topology ( true ) )
561
+ . RecoveryConfiguration ( recoveryConfiguration )
554
562
. ContainerId ( _containerId )
555
563
. Build ( ) ) ;
556
564
@@ -615,11 +623,13 @@ public async Task RemoveAnExchangeBoundToAnotherExchangeShouldRemoveTheBindings(
615
623
616
624
string destinationExchangeName = _exchangeName + "-destination" ;
617
625
626
+ var recoveryConfiguration = new RecoveryConfiguration ( ) ;
627
+ recoveryConfiguration . BackOffDelayPolicy ( new FakeFastBackOffDelay ( ) ) ;
628
+ recoveryConfiguration . Topology ( true ) ;
629
+
618
630
IConnection connection = await AmqpConnection . CreateAsync (
619
631
ConnectionSettingBuilder . Create ( )
620
- . RecoveryConfiguration ( RecoveryConfiguration . Create ( )
621
- . BackOffDelayPolicy ( new FakeFastBackOffDelay ( ) )
622
- . Topology ( true ) )
632
+ . RecoveryConfiguration ( recoveryConfiguration )
623
633
. ContainerId ( _containerId )
624
634
. Build ( ) ) ;
625
635
0 commit comments