feat: add none generic result type
This adds a none generic result type and refactors the result to be a class. The Result has the same inheritance like `Task` and `Task<T>`
This commit is contained in:
parent
f77c1ff29b
commit
cb2628c615
18 changed files with 2745 additions and 41 deletions
|
|
@ -172,4 +172,31 @@ internal sealed class ResultEqualityTests
|
|||
|
||||
await Assert.That(result.GetHashCode()).IsZero();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task I_can_equal_non_generic_result_and_get_true_for_success_and_success()
|
||||
{
|
||||
var a = Prelude.Success();
|
||||
var b = Prelude.Success();
|
||||
|
||||
await Assert.That(a.Equals(b)).IsTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task I_can_equal_non_generic_result_and_get_true_for_failure_and_failure()
|
||||
{
|
||||
var a = Prelude.Failure("error 1");
|
||||
var b = Prelude.Failure("error 2");
|
||||
|
||||
await Assert.That(a.Equals(b)).IsTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task I_can_equal_non_generic_result_and_get_false_for_success_and_failure()
|
||||
{
|
||||
var a = Prelude.Success();
|
||||
var b = Prelude.Failure("error");
|
||||
|
||||
await Assert.That(a.Equals(b)).IsFalse();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue