public async Task ErrorAsync_When_PassingResultIntoValueTaskAsyncMethod_Then_ResultShouldBeValueTaskOfResult() { const double ExpectedError = 65d; Result.IfError <double> result = await ComputeAsync(() => Result.ErrorAsync(65d)).ConfigureAwait(false); result.IsSuccess.Should().BeFalse(); result.Error.Should().Be(ExpectedError); }
public async Task ImplicitCast_WhenCastingToIfError_Then_ErrorShouldBeExpectedError() { const string ExpectedError = "Failed"; Result.IfError <string> result = await ComputeAsync(() => Result.ErrorAsync(ExpectedError)).ConfigureAwait(false); result.IsSuccess.Should().BeFalse(); result.Error.Should().Be(ExpectedError); }
public void ImplicitCast_WhenCastingToIfError_Then_ErrorShouldBeExpectedError() { const string ExpectedError = "Failed"; Result.IfError <string> result = Result.Error(ExpectedError); result.IsSuccess.Should().BeFalse(); result.Error.Should().Be(ExpectedError); }