Add tests/TarninaHub.Tests with health controller and SurrealDB endpoint builder tests, and register the test and layer projects in the solution.
35 lines
849 B
C#
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);
|
|
}
|
|
}
|