Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
MrBogomips committed Feb 12, 2024
1 parent b9a665f commit aea2680
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Added support for:
- `MapEach`: maps each `Result` in the sequence, preserving the failed `Result`s
- `BindEach`: binds each `Result` in the sequence, preserving the failed `Result`s
- `MatchEach`: matches each `Result` in the sequence
- `AggregateResult`: transforms a sequence of `Result`s into a single `Result` that contains a sequence of the successful values. If the original sequence contains any `Error` then will return a failed `Result` with an `AggregateError` containing all the errors found.
- `AggregateResults`: transforms a sequence of `Result`s into a single `Result` that contains a sequence of the successful values. If the original sequence contains any `Error` then will return a failed `Result` with an `AggregateError` containing all the errors found.

### Breaking Changes
- The following extension methods on `IEnumerable<Result<T>>` have been removed:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ The library provide a set of extension methods that enable manipulation of seque
* `MapEach`: Maps each `Result` in the sequence, preserving the failed `Result`s
* `BindEach`: Binds each `Result` in the sequence, preserving the failed `Result`s
* `MatchEach`: Matches each `Result` in the sequence
* `AggregateResult`: Transforms a sequence of `Result`s into a single `Result` that contains a sequence of the successful values. If the original sequence contains any `Error` then will return a failed `Result` with an `AggregateError` containing all the errors found.
* `AggregateResults`: Transforms a sequence of `Result`s into a single `Result` that contains a sequence of the successful values. If the original sequence contains any `Error` then will return a failed `Result` with an `AggregateError` containing all the errors found.

## Design Goals for `Error`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ public static IEnumerable<TResult> MatchEach<TValue, TResult>(
/// <typeparam name="TValue"></typeparam>
/// <returns></returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Result<IEnumerable<TValue?>> AggregateResult<TValue>(this IEnumerable<Result<TValue>> results)
public static Result<IEnumerable<TValue?>> AggregateResults<TValue>(this IEnumerable<Result<TValue>> results)
=> new ResultCollection<TValue>(results).ToResult();
}
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public void AggregateResult_AllSuccess_Returns_a_Success()
Result.Success(new Value(5))
};

var actual = results.AggregateResult();
var actual = results.AggregateResults();

actual.Should().BeOfType<Result<IEnumerable<Value>>>();
actual.IsSuccess.Should().BeTrue();
Expand All @@ -194,7 +194,7 @@ public void AggregateResult_AllFailures_Returns_a_Failure()
Result.Failure<Value>("Error 5")
};

var actual = results.AggregateResult();
var actual = results.AggregateResults();
var expectedError = new AggregateError(results.Select(r => r.GetErrorOrThrow()));

actual.Should().BeOfType<Result<IEnumerable<Value>>>();
Expand All @@ -215,7 +215,7 @@ public void AggregateResult_SomeFailures_Returns_a_Failure()
Result.Success(new Value(5))
};

var actual = results.AggregateResult();
var actual = results.AggregateResults();
var expectedError = new AggregateError(results.Where(r => r.IsFailure).Select(r => r.GetErrorOrThrow()));

actual.Should().BeOfType<Result<IEnumerable<Value>>>();
Expand Down

0 comments on commit aea2680

Please sign in to comment.