Refactor code structure and optimize performance across multiple modules
This commit is contained in:
@@ -2,13 +2,15 @@ using System.Text.Json;
|
||||
using StellaOps.Policy.RiskProfile.Validation;
|
||||
using Xunit;
|
||||
|
||||
using StellaOps.TestKit;
|
||||
namespace StellaOps.Policy.RiskProfile.Tests;
|
||||
|
||||
public class RiskProfileValidatorTests
|
||||
{
|
||||
private readonly RiskProfileValidator _validator = new();
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Valid_profile_passes_schema()
|
||||
{
|
||||
var profile = """
|
||||
@@ -43,7 +45,8 @@ public class RiskProfileValidatorTests
|
||||
Assert.True(result.IsValid, string.Join(" | ", result.Errors ?? Array.Empty<string>()));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Missing_required_fields_fails_schema()
|
||||
{
|
||||
var invalidProfile = """
|
||||
@@ -56,7 +59,8 @@ public class RiskProfileValidatorTests
|
||||
Assert.NotEmpty(result.Errors);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Empty_payload_throws()
|
||||
{
|
||||
Assert.Throws<ArgumentException>(() => _validator.Validate(" "));
|
||||
|
||||
Reference in New Issue
Block a user