Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Then/ThenAsync support for functions that don't explicitly return… #80

Merged
merged 3 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add missing test cases
  • Loading branch information
amantinband committed Jan 5, 2024
commit f09e070ab1cbcc40e2ea0ca15df9b0cecc3b738d
1 change: 1 addition & 0 deletions tests/ErrorOr.ThenAsyncTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public async Task CallingThenAsync_WhenIsError_ShouldReturnErrors()
// Act
ErrorOr<string> result = await errorOrString
.ThenAsync(str => ConvertToIntAsync(str))
.ThenAsync(num => Task.FromResult(num * 2))
.ThenAsync(num => ConvertToStringAsync(num));

// Assert
Expand Down
1 change: 1 addition & 0 deletions tests/ErrorOr.ThenTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public void CallingThen_WhenIsError_ShouldReturnErrors()
// Act
ErrorOr<string> result = errorOrString
.Then(str => ConvertToInt(str))
.Then(num => num * 2)
.Then(num => ConvertToString(num));

// Assert
Expand Down
Loading