Files
Rafał Tyński 1cbf965657 test(backend): add xUnit tests for the API skeleton
Add tests/TarninaHub.Tests with health controller and SurrealDB endpoint builder tests, and register the test and layer projects in the solution.
2026-10-04 01:49:56 +02:00

35 lines
849 B
C#

using TarninaHub.Infrastructure.Settings;
namespace TarninaHub.Tests.Infrastructure;
public class SurrealDbEndpointTests
{
[Fact]
public void Build_ReturnsRemoteUrl_WhenConfigured()
{
var settings = new SurrealDbSettings
{
RemoteUrl = "ws://127.0.0.1:8010/rpc",
};
var endpoint = SurrealDbEndpoint.Build(settings);
Assert.Equal("ws://127.0.0.1:8010/rpc", endpoint);
}
[Fact]
public void Build_ReturnsRocksDbEndpoint_WithForwardSlashes_WhenEmbedded()
{
var settings = new SurrealDbSettings
{
DataDirectory = "data",
};
var endpoint = SurrealDbEndpoint.Build(settings);
Assert.StartsWith("rocksdb://", endpoint);
Assert.DoesNotContain('\\', endpoint);
Assert.EndsWith("/data", endpoint);
}
}