-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactored `RailwayResult.FunctionalExtensions.Tests` (structure, namespaces ...) * extended unit tests to test exception propagation in extension methods
- Loading branch information
1 parent
07549ee
commit 752c3a0
Showing
73 changed files
with
1,763 additions
and
540 deletions.
There are no files selected for viewing
42 changes: 0 additions & 42 deletions
42
tests/RailwayResult.FunctionalExtensions.Tests/AndTests/AndTests.cs
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
tests/RailwayResult.FunctionalExtensions.Tests/AndTests/TheoryData_R2_And.cs
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
tests/RailwayResult.FunctionalExtensions.Tests/AndTests/TheoryData_TaskOfR2_And.cs
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
....FunctionalExtensions.Tests/BasicError.cs → ...tionalExtensions.Tests/Data/BasicError.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
namespace RailwayResult.FunctionalExtensions.Tests; | ||
namespace RailwayResult.FunctionalExtensions.Tests.Data; | ||
|
||
public sealed record BasicError(string Key, string Message) : Error(Key, Message); |
14 changes: 14 additions & 0 deletions
14
tests/RailwayResult.FunctionalExtensions.Tests/Data/BasicException.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,14 @@ | ||
namespace RailwayResult.FunctionalExtensions.Tests.Data; | ||
|
||
public sealed class BasicException : Exception | ||
{ | ||
public static void Throw() | ||
{ | ||
throw new BasicException(); | ||
} | ||
|
||
public static Out Throw<Out>() | ||
{ | ||
throw new BasicException(); | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...sult.FunctionalExtensions.Tests/Errors.cs → ...FunctionalExtensions.Tests/Data/Errors.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
2 changes: 1 addition & 1 deletion
2
...yResult.FunctionalExtensions.Tests/Obj.cs → ...lt.FunctionalExtensions.Tests/Data/Obj.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
51 changes: 0 additions & 51 deletions
51
tests/RailwayResult.FunctionalExtensions.Tests/EnsureNotNullTests/EnsureNotNullTests.cs
This file was deleted.
Oops, something went wrong.
49 changes: 0 additions & 49 deletions
49
tests/RailwayResult.FunctionalExtensions.Tests/EnsureTests/EnsureTests.cs
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...tionalExtensions.Tests/ErrorExtensions.cs → ...sions.Tests/Extensions/ErrorExtensions.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
2 changes: 1 addition & 1 deletion
2
...ionalExtensions.Tests/ResultExtensions.cs → ...ions.Tests/Extensions/ResultExtensions.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
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
35 changes: 0 additions & 35 deletions
35
tests/RailwayResult.FunctionalExtensions.Tests/TapAsyncTests/TapAsyncTests.cs
This file was deleted.
Oops, something went wrong.
57 changes: 0 additions & 57 deletions
57
tests/RailwayResult.FunctionalExtensions.Tests/TapTests/TapTests.cs
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
tests/RailwayResult.FunctionalExtensions.Tests/Tests/AndTests/AndTests.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,24 @@ | ||
namespace RailwayResult.FunctionalExtensions.Tests.Tests.AndTests; | ||
|
||
public sealed class AndTests : BaseTests | ||
{ | ||
[Theory] | ||
[ClassData(typeof(TheoryData_R1_And))] | ||
public void R1_And(Func<R1, R2> and, R1 input, R2? expectedOutput) => Verify(and, input, expectedOutput); | ||
|
||
[Theory] | ||
[ClassData(typeof(TheoryData_TaskOfR1_And))] | ||
public async Task TaskOfR1_And(Func<Task<R1>, Task<R2>> and, R1 input, R2? expectedOutput) => await VerifyAsync(and, input, expectedOutput); | ||
|
||
[Theory] | ||
[ClassData(typeof(TheoryData_R2_And))] | ||
public void R2_And(Func<R2, R3> and, R2 input, R3? expectedOutput) => Verify(and, input, expectedOutput); | ||
|
||
[Theory] | ||
[ClassData(typeof(TheoryData_TaskOfR2_And))] | ||
public async Task TaskOfR2_And(Func<Task<R2>, Task<R3>> and, R2 input, R3? expectedOutput) => await VerifyAsync(and, input, expectedOutput); | ||
|
||
[Theory] | ||
[ClassData(typeof(TheoryData_R1_AndAsync))] | ||
public async Task R1_AndAsync(Func<R1, Task<R2>> andAsync, R1 input, R2? expectedOutput) => await VerifyAsync(andAsync, input, expectedOutput); | ||
} |
Oops, something went wrong.