request/src/request.result.tests/ErrorTests.cs
Louis Seubert af610beb8f
All checks were successful
default / dotnet-default-workflow (push) Successful in 1m29s
feat: add inital in memory dispatcher
Add a simple in memory dispatcher for scalar requests and stream request.
2026-05-09 22:24:01 +02:00

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>();
}
}