SDT/tests/DevTool.Tests/DebugConfigTests.cs
2026-03-01 20:52:56 -06:00

41 lines
1.0 KiB
C#

using System.Text.Json;
using Sdt.Config;
using Xunit;
namespace DevTool.Tests;
public sealed class DebugConfigTests
{
[Fact]
public void DebugSectionAbsent_DeserializesWithSafeDefaults()
{
const string json = """
{
"name": "Test",
"version": "1.0.0",
"workflows": []
}
""";
var cfg = JsonSerializer.Deserialize<DevToolConfig>(json, new JsonSerializerOptions
{
PropertyNameCaseInsensitive = true,
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
AllowTrailingCommas = true,
ReadCommentHandling = JsonCommentHandling.Skip
});
Assert.NotNull(cfg);
Assert.Null(cfg!.Debug);
}
[Fact]
public void DebugDiagnostics_DefaultOutputDir_IsSdtDebug()
{
var options = new DebugDiagnosticsOptions();
Assert.True(options.Enabled);
Assert.True(options.BundleOnFailure);
Assert.Equal(".sdt/debug", options.OutputDir);
}
}