GPG key ID:
4B9DB28F826553BD
150 changed files with
151 additions and
151 deletions
|
|
|
|
@ -24,4 +24,4 @@ internal sealed class ErrorTests
|
|
|
|
|
var instance = await Assert.That(error).IsTypeOf<ExceptionError>();
|
|
|
|
|
await Assert.That(instance?.Exception).IsTypeOf<CustomTestException>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -47,4 +47,4 @@ internal sealed class ExtensionsEnumerableTests
|
|
|
|
|
await Assert.That(result.IsSuccess).IsTrue();
|
|
|
|
|
await Assert.That(result.Value).IsEmpty();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -97,4 +97,4 @@ internal sealed class PreludeTests
|
|
|
|
|
var instance = await Assert.That(result.Error).IsTypeOf<ExceptionError>();
|
|
|
|
|
await Assert.That(instance?.Exception).IsTypeOf<CustomTestException>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -61,4 +61,4 @@ internal sealed class ResultConversionTests
|
|
|
|
|
|
|
|
|
|
await Assert.That(() => (int)result).Throws<UnwrapException>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -172,4 +172,4 @@ internal sealed class ResultEqualityTests
|
|
|
|
|
|
|
|
|
|
await Assert.That(result.GetHashCode()).IsZero();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -229,4 +229,4 @@ internal sealed class ResultMatchingTests
|
|
|
|
|
return ValueTask.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -56,4 +56,4 @@ internal sealed class ResultTests
|
|
|
|
|
|
|
|
|
|
await Assert.That(result.ToString()).IsEqualTo("Failure { error }");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -641,4 +641,4 @@ internal sealed class ResultTransformTests
|
|
|
|
|
await Assert.That(result.Error).IsTypeOf<StringError>();
|
|
|
|
|
await Assert.That(result.Error?.Message).IsEqualTo("error");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -96,4 +96,4 @@ internal sealed class ResultUnboxTests
|
|
|
|
|
await Assert.That(error).IsEqualTo(default(Error));
|
|
|
|
|
await Assert.That(value).IsEqualTo(2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -8,4 +8,4 @@ internal sealed class CustomTestError : Error
|
|
|
|
|
internal const string DefaultMessage = "This is a custom error for test";
|
|
|
|
|
|
|
|
|
|
public override string Message => DefaultMessage;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -5,4 +5,4 @@ namespace Geekeey.Request.Result.Tests;
|
|
|
|
|
|
|
|
|
|
internal sealed class CustomTestException : Exception
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -98,4 +98,4 @@ public static class Prelude
|
|
|
|
|
return new Result<T>(new ExceptionError(exception));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -48,4 +48,4 @@ public readonly partial struct Result<T>
|
|
|
|
|
{
|
|
|
|
|
return result.Unwrap();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -160,4 +160,4 @@ public readonly partial struct Result<T> : IEqualityOperators<Result<T>, Result<
|
|
|
|
|
{
|
|
|
|
|
return !Equals(a, b, EqualityComparer<T>.Default);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -101,4 +101,4 @@ public readonly partial struct Result<T>
|
|
|
|
|
{
|
|
|
|
|
return IsSuccess ? success(Value) : failure(Error);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -363,4 +363,4 @@ public readonly partial struct Result<T>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -63,4 +63,4 @@ public readonly partial struct Result<T>
|
|
|
|
|
|
|
|
|
|
return !IsSuccess;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -75,4 +75,4 @@ public readonly partial struct Result<T>
|
|
|
|
|
|
|
|
|
|
public object? Value => result.IsSuccess ? result.Value : result.Error;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -24,4 +24,4 @@ public sealed class AggregateError : Error
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
public override string Message => string.Join(Environment.NewLine, Errors.Select(error => error.Message));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -53,4 +53,4 @@ public abstract class Error
|
|
|
|
|
{
|
|
|
|
|
return new ExceptionError(exception);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|