Some checks failed
default / dotnet-default-workflow (push) Failing after 1m24s
Add a simple in memory dispatcher for scalar requests and stream request.
27 lines
No EOL
744 B
C#
27 lines
No EOL
744 B
C#
// Copyright (c) The Geekeey Authors
|
|
// SPDX-License-Identifier: EUPL-1.2
|
|
|
|
namespace Geekeey.Request.Result.Tests;
|
|
|
|
internal sealed class ErrorTests
|
|
{
|
|
[Test]
|
|
public async Task I_can_implicitly_convert_from_string_and_get_string_error()
|
|
{
|
|
Error error = "error";
|
|
|
|
using var scope = Assert.Multiple();
|
|
await Assert.That(error).IsTypeOf<StringError>();
|
|
await Assert.That(error.Message).IsEqualTo("error");
|
|
}
|
|
|
|
[Test]
|
|
public async Task I_can_implicitly_convert_from_exception_and_get_exception_error()
|
|
{
|
|
Error error = new CustomTestException();
|
|
|
|
using var scope = Assert.Multiple();
|
|
var instance = await Assert.That(error).IsTypeOf<ExceptionError>();
|
|
await Assert.That(instance?.Exception).IsTypeOf<CustomTestException>();
|
|
}
|
|
} |