diff --git a/README.md b/README.md index 93de678..f554f92 100644 --- a/README.md +++ b/README.md @@ -56,8 +56,8 @@ It is a generic type, with `T` representing the type of the value returned by th * `Match`: Facilitates handling of the operation's result by providing separate paths for the "happy" and "unhappy" flows. * `RecoverWith`: Provides a way to recover from an error by returning a `Result` * `Ensure`: Allows asserting a condition on the value returned by the operation. -* `ExecuteIfSuccess`: Executes if the operation succeeds. It is typically used to generate side effects. -* `ExecuteIfFailure`: Executes if the operation fails. It is typically used to generate side effects. +* `IfSuccess`: Executes if the operation succeeds. It is typically used to generate side effects. +* `IfFailure`: Executes if the operation fails. It is typically used to generate side effects. There are also some unsafe methods intended to support developers who are less familiar with the functional approach and may need to resort to a procedural style to achieve their goals. @@ -95,7 +95,7 @@ public Result Publish() { return ValidateCostComponents() // Note the explicit invocation of the method .Bind(ValidateTimingComponents) // ... more binding to validation methods - .ExecuteIfSuccess(() => PublishingStatus = PublishingStatus.Published); + .IfSuccess(() => PublishingStatus = PublishingStatus.Published); } ``` @@ -107,7 +107,7 @@ public Result Publish() => Result .Bind(ValidateCostComponents) .Bind(ValidateTimingComponents) // ... more binding to validation methods - .ExecuteIfSuccess(() => PublishingStatus = PublishingStatus.Published); + .IfSuccess(() => PublishingStatus = PublishingStatus.Published); ``` ## Manipulating `IEnumerable>` diff --git a/sample/ConsoleApp/Pipelines/CreateUserPipeline.cs b/sample/ConsoleApp/Pipelines/CreateUserPipeline.cs index 9b8f388..0ea80e3 100644 --- a/sample/ConsoleApp/Pipelines/CreateUserPipeline.cs +++ b/sample/ConsoleApp/Pipelines/CreateUserPipeline.cs @@ -16,7 +16,7 @@ public static void Run(string? username = null!) .Ensure(u => LookupUser(u).IsNone, new LogicError("User already exists")) .Map(u => new User(u, "FirstName", "LastName")) .Bind(CreateUser) - .ExecuteIfSuccess(NotifyCreation) + .IfSuccess(NotifyCreation) .Match(u => "User created.", e => $"The following error occurred: {e.Message}"); // In a real example the final Match would return a specific model, for example, an IActionResult diff --git a/src/Monads/Maybe/Maybe.cs b/src/Monads/Maybe/Maybe.cs index 5d31dec..888a6cf 100644 --- a/src/Monads/Maybe/Maybe.cs +++ b/src/Monads/Maybe/Maybe.cs @@ -138,14 +138,14 @@ public Task Match(Func mapValue, Func /// Execute the action if the is Some. /// - public Maybe ExecuteIfSome(Action action) + public Maybe IfSome(Action action) { if (Value is not null) action(Value); return this; } - /// - public async Task> ExecuteIfSome(Func action) + /// + public async Task> IfSome(Func action) { if (Value is not null) await action(Value); return this; diff --git a/src/Monads/Maybe/MaybeAsyncExtensions.cs b/src/Monads/Maybe/MaybeAsyncExtensions.cs index e1c1aa1..4526788 100644 --- a/src/Monads/Maybe/MaybeAsyncExtensions.cs +++ b/src/Monads/Maybe/MaybeAsyncExtensions.cs @@ -129,40 +129,40 @@ public static async Task Match( => await (await maybeTask).Match(value, none); [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static async Task> ExecuteIfSome( + public static async Task> IfSome( this Task> maybeTask, Action action) where TValue : class - => (await maybeTask).ExecuteIfSome(action); + => (await maybeTask).IfSome(action); [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static async Task> ExecuteIfSome( + public static async Task> IfSome( this Task> maybeTask, Action action) where TValue : class - => (await maybeTask).ExecuteIfSome(action); + => (await maybeTask).IfSome(action); [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static async Task> ExecuteIfSome( + public static async Task> IfSome( this Task> maybeTask, Func action) where TValue : class - => await (await maybeTask).ExecuteIfSome(action); + => await (await maybeTask).IfSome(action); [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static async Task> ExecuteIfSome( + public static async Task> IfSome( this Task> maybeTask, Func action) where TValue : class - => await (await maybeTask).ExecuteIfSome(action); + => await (await maybeTask).IfSome(action); [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static async Task> ExecuteIfNone( + public static async Task> IfNone( this Task> maybeTask, Action action) where TValue : class - => (await maybeTask).ExecuteIfNone(action); + => (await maybeTask).IfNone(action); [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static async Task> ExecuteIfNone( + public static async Task> IfNone( this Task> maybeTask, Func action) where TValue : class - => await (await maybeTask).ExecuteIfNone(action); + => await (await maybeTask).IfNone(action); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static async Task> Execute( diff --git a/src/Monads/Maybe/MaybeExtensions.cs b/src/Monads/Maybe/MaybeExtensions.cs index 3c16a84..4468330 100644 --- a/src/Monads/Maybe/MaybeExtensions.cs +++ b/src/Monads/Maybe/MaybeExtensions.cs @@ -169,16 +169,16 @@ public static async Task> Execute(this Maybe maybe /// Execute the action if the is Some. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ref readonly Maybe ExecuteIfSome(in this Maybe maybe, Action action) + public static ref readonly Maybe IfSome(in this Maybe maybe, Action action) where TValue : class { if (maybe.IsSome) action(); return ref maybe; } - /// + /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static async Task> ExecuteIfSome(this Maybe maybe, Func action) + public static async Task> IfSome(this Maybe maybe, Func action) where TNewValue : class { if (maybe.IsSome) await action(); @@ -189,16 +189,16 @@ public static async Task> ExecuteIfSome(this Maybe is None. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ref readonly Maybe ExecuteIfNone(in this Maybe maybe, Action action) + public static ref readonly Maybe IfNone(in this Maybe maybe, Action action) where TNewValue : class { if (maybe.IsNone) action(); return ref maybe; } - /// + /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static async Task> ExecuteIfNone(this Maybe maybe, Func action) + public static async Task> IfNone(this Maybe maybe, Func action) where TNewValue : class { if (maybe.IsNone) await action(); diff --git a/src/Monads/Result/Result.cs b/src/Monads/Result/Result.cs index 6d5da62..3c687e7 100644 --- a/src/Monads/Result/Result.cs +++ b/src/Monads/Result/Result.cs @@ -370,14 +370,14 @@ public async Task> Ensure(Func> predicate, Fun /// /// Execute the action if the . is true. /// - public Result ExecuteIfSuccess(Action action) + public Result IfSuccess(Action action) { if (IsSuccess) action(Value!); return this; } - /// - public async Task> ExecuteIfSuccess(Func action) + /// + public async Task> IfSuccess(Func action) { if (IsSuccess) await action(Value!); return this; @@ -386,15 +386,15 @@ public async Task> ExecuteIfSuccess(Func action) /// /// Execute the action if the . is true. /// - public Result ExecuteIfFailure(Action action) + public Result IfFailure(Action action) { if (IsFailure) action(Error!); return this; } - /// - public async Task> ExecuteIfFailure(Func action) + /// + public async Task> IfFailure(Func action) { if (IsFailure) await action(Error!); return this; diff --git a/src/Monads/Result/ResultExecuteExtensions.cs b/src/Monads/Result/ResultExecuteExtensions.cs index b587d95..7d77a27 100644 --- a/src/Monads/Result/ResultExecuteExtensions.cs +++ b/src/Monads/Result/ResultExecuteExtensions.cs @@ -11,7 +11,7 @@ public static class ResultExecuteExtensions #region Functional Closure Extensions [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Result ExecuteIfSuccess( + public static Result IfSuccess( this Result result, Action action) { if (result.IsSuccess) action(); @@ -19,7 +19,7 @@ public static Result ExecuteIfSuccess( } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static async Task> ExecuteIfSuccess( + public static async Task> IfSuccess( this Result result, Func action) { if (result.IsSuccess) await action(); @@ -27,7 +27,7 @@ public static async Task> ExecuteIfSuccess( } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Result ExecuteIfFailure( + public static Result IfFailure( this Result result, Action action) { if (result.IsFailure) action(); @@ -35,7 +35,7 @@ public static Result ExecuteIfFailure( } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static async Task> ExecuteIfFailure( + public static async Task> IfFailure( this Result result, Func action) { if (result.IsFailure) await action(); @@ -78,44 +78,44 @@ public static async Task> Execute( #region Left Async Extensions [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static async Task> ExecuteIfSuccess( + public static async Task> IfSuccess( this Task> result, Action action) - => (await result).ExecuteIfSuccess(action); + => (await result).IfSuccess(action); [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static async Task> ExecuteIfSuccess( + public static async Task> IfSuccess( this Task> result, Func action) - => await (await result).ExecuteIfSuccess(action); + => await (await result).IfSuccess(action); [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static async Task> ExecuteIfSuccess( + public static async Task> IfSuccess( this Task> result, Action action) - => (await result).ExecuteIfSuccess(action); + => (await result).IfSuccess(action); [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static async Task> ExecuteIfSuccess( + public static async Task> IfSuccess( this Task> result, Func action) - => await (await result).ExecuteIfSuccess(action); + => await (await result).IfSuccess(action); [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static async Task> ExecuteIfFailure( + public static async Task> IfFailure( this Task> result, Action action) - => (await result).ExecuteIfFailure(action); + => (await result).IfFailure(action); [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static async Task> ExecuteIfFailure( + public static async Task> IfFailure( this Task> result, Func action) - => await (await result).ExecuteIfFailure(action); + => await (await result).IfFailure(action); [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static async Task> ExecuteIfFailure( + public static async Task> IfFailure( this Task> result, Action action) - => (await result).ExecuteIfFailure(action); + => (await result).IfFailure(action); [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static async Task> ExecuteIfFailure( + public static async Task> IfFailure( this Task> result, Func action) - => await (await result).ExecuteIfFailure(action); + => await (await result).IfFailure(action); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static async Task> Execute( diff --git a/test/Monads.UnitTests/MaybeTests/MaybeAsyncTests.cs b/test/Monads.UnitTests/MaybeTests/MaybeAsyncTests.cs index 8a21465..5d9fb09 100644 --- a/test/Monads.UnitTests/MaybeTests/MaybeAsyncTests.cs +++ b/test/Monads.UnitTests/MaybeTests/MaybeAsyncTests.cs @@ -256,7 +256,7 @@ public async Task IfSome_action() { var inspector = new Mock(); var sut = Task.FromResult(Maybe.Some(new Value(0))); - await sut.ExecuteIfSome(inspector.Object.MethodVoid); + await sut.IfSome(inspector.Object.MethodVoid); inspector.Verify(c => c.MethodVoid()); } @@ -265,7 +265,7 @@ public async Task IfSome_action_with_arg() { var inspector = new Mock(); var sut = Task.FromResult(Maybe.Some(new Value(0))); - await sut.ExecuteIfSome(inspector.Object.MethodWithValueArg); + await sut.IfSome(inspector.Object.MethodWithValueArg); inspector.Verify(c => c.MethodWithValueArg(It.IsAny())); } @@ -274,7 +274,7 @@ public async Task IfSome_asyncAction() { var inspector = new Mock(); var sut = Task.FromResult(Maybe.Some(new Value(0))); - await sut.ExecuteIfSome(inspector.Object.MethodVoidAsync); + await sut.IfSome(inspector.Object.MethodVoidAsync); inspector.Verify(c => c.MethodVoidAsync()); } @@ -283,7 +283,7 @@ public async Task IfSome_asyncAction_with_arg() { var inspector = new Mock(); var sut = Task.FromResult(Maybe.Some(new Value(0))); - await sut.ExecuteIfSome(inspector.Object.MethodWithValueArgAsync); + await sut.IfSome(inspector.Object.MethodWithValueArgAsync); inspector.Verify(c => c.MethodWithValueArgAsync(It.IsAny())); } @@ -292,7 +292,7 @@ public async Task IfNone_action() { var inspector = new Mock(); var sut = Task.FromResult(Maybe.None()); - await sut.ExecuteIfNone(inspector.Object.MethodVoid); + await sut.IfNone(inspector.Object.MethodVoid); inspector.Verify(c => c.MethodVoid()); } [Fact] @@ -300,7 +300,7 @@ public async Task IfNone_actionAsync() { var inspector = new Mock(); var sut = Task.FromResult(Maybe.None()); - await sut.ExecuteIfNone(inspector.Object.MethodVoidAsync); + await sut.IfNone(inspector.Object.MethodVoidAsync); inspector.Verify(c => c.MethodVoidAsync()); } diff --git a/test/Monads.UnitTests/MaybeTests/MaybeExecuteTests.cs b/test/Monads.UnitTests/MaybeTests/MaybeExecuteTests.cs index 280aa74..5fa27cb 100644 --- a/test/Monads.UnitTests/MaybeTests/MaybeExecuteTests.cs +++ b/test/Monads.UnitTests/MaybeTests/MaybeExecuteTests.cs @@ -10,7 +10,7 @@ public class MaybeExecuteTests public void IfSome_call_void_when_maybeIsSome() { var sut = Maybe.Some(new Value(0)); - sut.ExecuteIfSome(_inspector.Object.MethodVoid); + sut.IfSome(_inspector.Object.MethodVoid); _inspector.Verify(i => i.MethodVoid()); } @@ -18,7 +18,7 @@ public void IfSome_call_void_when_maybeIsSome() public void IfSome_doesntCall_void_when_maybeIsNone() { var sut = Maybe.None(); - sut.ExecuteIfSome(_inspector.Object.MethodVoid); + sut.IfSome(_inspector.Object.MethodVoid); _inspector.VerifyNoOtherCalls(); } @@ -26,7 +26,7 @@ public void IfSome_doesntCall_void_when_maybeIsNone() public void IfNone_doesntCall_void_when_maybeIsSome() { var sut = Maybe.None(); - sut.ExecuteIfNone(_inspector.Object.MethodVoid); + sut.IfNone(_inspector.Object.MethodVoid); _inspector.Verify(i => i.MethodVoid()); } @@ -34,7 +34,7 @@ public void IfNone_doesntCall_void_when_maybeIsSome() public void IfNone_call_void_when_maybeIsNone() { var sut = Maybe.Some(new Value(0)); - sut.ExecuteIfNone(_inspector.Object.MethodVoid); + sut.IfNone(_inspector.Object.MethodVoid); _inspector.VerifyNoOtherCalls(); } @@ -42,7 +42,7 @@ public void IfNone_call_void_when_maybeIsNone() public void IfSome_call_withArg_when_maybeIsSome() { var sut = Maybe.Some(new Value(0)); - sut.ExecuteIfSome(_inspector.Object.MethodWithValueArg); + sut.IfSome(_inspector.Object.MethodWithValueArg); _inspector.Verify(i => i.MethodWithValueArg(It.IsAny())); } @@ -50,7 +50,7 @@ public void IfSome_call_withArg_when_maybeIsSome() public void IfSome_doesntCall_withArg_when_maybeIsNone() { var sut = Maybe.None(); - sut.ExecuteIfSome(_inspector.Object.MethodWithValueArg); + sut.IfSome(_inspector.Object.MethodWithValueArg); _inspector.VerifyNoOtherCalls(); } @@ -58,7 +58,7 @@ public void IfSome_doesntCall_withArg_when_maybeIsNone() public async Task IfSome_call_async_when_maybeIsSome() { var sut = Maybe.Some(new Value(0)); - await sut.ExecuteIfSome(_inspector.Object.MethodVoidAsync); + await sut.IfSome(_inspector.Object.MethodVoidAsync); _inspector.Verify(i => i.MethodVoidAsync()); } @@ -66,7 +66,7 @@ public async Task IfSome_call_async_when_maybeIsSome() public async Task IfSome_doesntCall_async_when_maybeIsNone() { var sut = Maybe.None(); - await sut.ExecuteIfSome(_inspector.Object.MethodVoidAsync); + await sut.IfSome(_inspector.Object.MethodVoidAsync); _inspector.VerifyNoOtherCalls(); } @@ -74,7 +74,7 @@ public async Task IfSome_doesntCall_async_when_maybeIsNone() public async Task IfNone_doesntCall_async_when_maybeIsSome() { var sut = Maybe.None(); - await sut.ExecuteIfNone(_inspector.Object.MethodVoidAsync); + await sut.IfNone(_inspector.Object.MethodVoidAsync); _inspector.Verify(i => i.MethodVoidAsync()); } @@ -82,7 +82,7 @@ public async Task IfNone_doesntCall_async_when_maybeIsSome() public async Task IfNone_call_void_async_maybeIsNone() { var sut = Maybe.Some(new Value(0)); - await sut.ExecuteIfNone(_inspector.Object.MethodVoidAsync); + await sut.IfNone(_inspector.Object.MethodVoidAsync); _inspector.VerifyNoOtherCalls(); } @@ -90,7 +90,7 @@ public async Task IfNone_call_void_async_maybeIsNone() public async Task IfSome_call_asyncArg_when_maybeIsSome() { var sut = Maybe.Some(new Value(0)); - await sut.ExecuteIfSome(_inspector.Object.MethodWithValueArgAsync); + await sut.IfSome(_inspector.Object.MethodWithValueArgAsync); _inspector.Verify(i => i.MethodWithValueArgAsync(It.IsAny())); } @@ -98,7 +98,7 @@ public async Task IfSome_call_asyncArg_when_maybeIsSome() public async Task IfSome_doesntCall_asyncArg_when_maybeIsNone() { var sut = Maybe.None(); - await sut.ExecuteIfSome(_inspector.Object.MethodWithValueArgAsync); + await sut.IfSome(_inspector.Object.MethodWithValueArgAsync); _inspector.VerifyNoOtherCalls(); } diff --git a/test/Monads.UnitTests/ResultTests/ResultExecuteTests.cs b/test/Monads.UnitTests/ResultTests/ResultExecuteTests.cs index 199089d..14f340b 100644 --- a/test/Monads.UnitTests/ResultTests/ResultExecuteTests.cs +++ b/test/Monads.UnitTests/ResultTests/ResultExecuteTests.cs @@ -11,112 +11,112 @@ public class ResultExecuteTests [Fact] public void Successful_executeIfSuccess_calls_voidFunction() { - _success.ExecuteIfSuccess(_inspector.Object.MethodVoid); + _success.IfSuccess(_inspector.Object.MethodVoid); _inspector.Verify(i => i.MethodVoid()); } [Fact] public void Successful_executeIfFailure_doesntCall_voidFunction() { - _success.ExecuteIfFailure(_inspector.Object.MethodVoid); + _success.IfFailure(_inspector.Object.MethodVoid); _inspector.VerifyNoOtherCalls(); } [Fact] public void Failure_executeIfSuccess_doesntCall_voidFunction() { - _failed.ExecuteIfSuccess(_inspector.Object.MethodVoid); + _failed.IfSuccess(_inspector.Object.MethodVoid); _inspector.VerifyNoOtherCalls(); } [Fact] public void Failure_executeIfFailure_calls_voidFunction() { - _failed.ExecuteIfFailure(_inspector.Object.MethodVoid); + _failed.IfFailure(_inspector.Object.MethodVoid); _inspector.Verify(i => i.MethodVoid()); } [Fact] public async Task Successful_executeIfSuccess_calls_asyncVoidFunction() { - await _success.ExecuteIfSuccess(_inspector.Object.MethodVoidAsync); + await _success.IfSuccess(_inspector.Object.MethodVoidAsync); _inspector.Verify(i => i.MethodVoidAsync()); } [Fact] public async Task Successful_executeIfFailure_doesntCall_asyncVoidFunction() { - await _success.ExecuteIfFailure(_inspector.Object.MethodVoidAsync); + await _success.IfFailure(_inspector.Object.MethodVoidAsync); _inspector.VerifyNoOtherCalls(); } [Fact] public async Task Failure_executeIfSuccess_doesntCall_asyncVoidFunction() { - await _failed.ExecuteIfSuccess(_inspector.Object.MethodVoidAsync); + await _failed.IfSuccess(_inspector.Object.MethodVoidAsync); _inspector.VerifyNoOtherCalls(); } [Fact] public async Task Failure_executeIfFailure_calls_asyncVoidFunction() { - await _failed.ExecuteIfFailure(_inspector.Object.MethodVoidAsync); + await _failed.IfFailure(_inspector.Object.MethodVoidAsync); _inspector.Verify(i => i.MethodVoidAsync()); } [Fact] public void Successful_executeIfSuccess_calls_function() { - _success.ExecuteIfSuccess(_inspector.Object.MethodWithValueArg); + _success.IfSuccess(_inspector.Object.MethodWithValueArg); _inspector.Verify(i => i.MethodWithValueArg(It.IsAny())); } [Fact] public void Successful_executeIfFailure_doesntCall_function() { - _success.ExecuteIfFailure(_inspector.Object.MethodWithErrorArg); + _success.IfFailure(_inspector.Object.MethodWithErrorArg); _inspector.VerifyNoOtherCalls(); } [Fact] public void Failure_executeIfSuccess_doesntCall_function() { - _failed.ExecuteIfSuccess(_inspector.Object.MethodWithValueArg); + _failed.IfSuccess(_inspector.Object.MethodWithValueArg); _inspector.VerifyNoOtherCalls(); } [Fact] public void Failure_executeIfFailure_calls_function() { - _failed.ExecuteIfFailure(_inspector.Object.MethodWithErrorArg); + _failed.IfFailure(_inspector.Object.MethodWithErrorArg); _inspector.Verify(i => i.MethodWithErrorArg(It.IsAny())); } [Fact] public async Task Successful_executeIfSuccess_calls_asyncFunction() { - await _success.ExecuteIfSuccess(_inspector.Object.MethodWithValueArgAsync); + await _success.IfSuccess(_inspector.Object.MethodWithValueArgAsync); _inspector.Verify(i => i.MethodWithValueArgAsync(It.IsAny())); } [Fact] public async Task Successful_executeIfFailure_doesntCall_asyncFunction() { - await _success.ExecuteIfFailure(_inspector.Object.MethodWithErrorArgAsync); + await _success.IfFailure(_inspector.Object.MethodWithErrorArgAsync); _inspector.VerifyNoOtherCalls(); } [Fact] public async Task Failure_executeIfSuccess_doesntCall_asyncFunction() { - await _failed.ExecuteIfSuccess(_inspector.Object.MethodWithValueArgAsync); + await _failed.IfSuccess(_inspector.Object.MethodWithValueArgAsync); _inspector.VerifyNoOtherCalls(); } [Fact] public async Task Failure_executeIfFailure_calls_asyncFunction() { - await _failed.ExecuteIfFailure(_inspector.Object.MethodWithErrorArgAsync); + await _failed.IfFailure(_inspector.Object.MethodWithErrorArgAsync); _inspector.Verify(i => i.MethodWithErrorArgAsync(It.IsAny())); } diff --git a/test/Monads.UnitTests/ResultTests/ResultThrowIfFailureTests.cs b/test/Monads.UnitTests/ResultTests/ResultThrowIfFailureTests.cs index a7739f3..f1332cc 100644 --- a/test/Monads.UnitTests/ResultTests/ResultThrowIfFailureTests.cs +++ b/test/Monads.UnitTests/ResultTests/ResultThrowIfFailureTests.cs @@ -63,7 +63,7 @@ public async Task ResultThrowIfFailureAsync_WhenResultIsFailure_ThrowsResultFail try { await result - .ExecuteIfFailure(() => { }) + .IfFailure(() => { }) .ThrowIfFailure(); } catch (ResultFailedException)