-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance callback API with handling of void-based results (#1155)
- Loading branch information
Showing
22 changed files
with
919 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Polly.Strategy; | ||
|
||
namespace Polly.Core.Tests.Strategy; | ||
|
||
public class VoidOutcomeEventTests | ||
{ | ||
[Fact] | ||
public void IsEmpty_Ok() | ||
{ | ||
var ev = new VoidOutcomeEvent<TestArguments>(); | ||
|
||
ev.IsEmpty.Should().BeTrue(); | ||
|
||
ev.Register(() => { }); | ||
|
||
ev.IsEmpty.Should().BeFalse(); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/Polly.Core.Tests/Strategy/VoidOutcomeGeneratorTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Polly.Strategy; | ||
|
||
namespace Polly.Core.Tests.Strategy; | ||
|
||
public class VoidOutcomeGeneratorTests | ||
{ | ||
[Fact] | ||
public void IsEmpty_Ok() | ||
{ | ||
var ev = new VoidOutcomeGenerator<TestArguments, int>(); | ||
|
||
ev.IsEmpty.Should().BeTrue(); | ||
|
||
ev.SetGenerator((_, _) => 10); | ||
|
||
ev.IsEmpty.Should().BeFalse(); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/Polly.Core.Tests/Strategy/VoidOutcomePredicateTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Polly.Strategy; | ||
|
||
namespace Polly.Core.Tests.Strategy; | ||
|
||
public class VoidOutcomePredicateTests | ||
{ | ||
[Fact] | ||
public void IsEmpty_Ok() | ||
{ | ||
var ev = new VoidOutcomePredicate<TestArguments>(); | ||
|
||
ev.IsEmpty.Should().BeTrue(); | ||
|
||
ev.HandleException<InvalidOperationException>(); | ||
|
||
ev.IsEmpty.Should().BeFalse(); | ||
} | ||
} |
Oops, something went wrong.