feat: initial project commit
All checks were successful
default / default (8.0) (push) Successful in 1m7s
All checks were successful
default / default (8.0) (push) Successful in 1m7s
This commit is contained in:
commit
30ef7bd477
40 changed files with 3752 additions and 0 deletions
30
src/Result.Tests/ErrorTests.cs
Normal file
30
src/Result.Tests/ErrorTests.cs
Normal file
|
@ -0,0 +1,30 @@
|
|||
namespace Geekeey.Extensions.Result.Tests;
|
||||
|
||||
[TestFixture]
|
||||
internal sealed class ErrorTests
|
||||
{
|
||||
[Test]
|
||||
public void ImplicitConversion_FromString_ReturnsStringError()
|
||||
{
|
||||
Error error = "error";
|
||||
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(error, Is.InstanceOf<StringError>());
|
||||
Assert.That(error.Message, Is.EqualTo("error"));
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ImplicitConversion_FromException_ReturnsExceptionError()
|
||||
{
|
||||
Error error = new CustomTestException();
|
||||
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(error, Is.InstanceOf<ExceptionError>());
|
||||
var instance = error as ExceptionError;
|
||||
Assert.That(instance?.Exception, Is.InstanceOf<CustomTestException>());
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue