Skip to content

Commit

Permalink
test(Result): Result value types behave as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
MrBogomips committed Jul 30, 2024
1 parent e959f79 commit 7ab86c4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/Monads.UnitTests/ResultTests/ResultValueTypeTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
namespace Bogoware.Monads.UnitTests.ResultTests;

public class ResultValueTypeTests
{
[Fact]
public void Result_with_value_type_should_be_successful()
{
var result = Result.Success(1);
result.IsSuccess.Should().BeTrue();
result.GetValueOrThrow().Should().Be(1);
}

[Fact]
public void Result_with_value_type_should_be_failed()
{
var result = Result.Failure<int>("error");
result.IsFailure.Should().BeTrue();
}
}

0 comments on commit 7ab86c4

Please sign in to comment.