Refactor code structure and optimize performance across multiple modules
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
using StellaOps.Concelier.Models;
|
||||
using Xunit;
|
||||
|
||||
using StellaOps.TestKit;
|
||||
namespace StellaOps.Concelier.Models.Tests;
|
||||
|
||||
public sealed class SemVerPrimitiveTests
|
||||
{
|
||||
[Theory]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Theory]
|
||||
[InlineData("1.0.0", true, "2.0.0", false, null, false, null, null, SemVerPrimitiveStyles.Range)]
|
||||
[InlineData("1.0.0", true, null, false, null, false, null, null, SemVerPrimitiveStyles.GreaterThanOrEqual)]
|
||||
[InlineData("1.0.0", false, null, false, null, false, null, null, SemVerPrimitiveStyles.GreaterThan)]
|
||||
@@ -38,7 +40,8 @@ public sealed class SemVerPrimitiveTests
|
||||
Assert.Equal(expectedStyle, primitive.Style);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void EqualityIncludesExactValue()
|
||||
{
|
||||
var baseline = new SemVerPrimitive(
|
||||
@@ -57,7 +60,8 @@ public sealed class SemVerPrimitiveTests
|
||||
Assert.Equal(SemVerPrimitiveStyles.Range, baseline.Style);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void ToNormalizedVersionRule_MapsRangeBounds()
|
||||
{
|
||||
var primitive = new SemVerPrimitive(
|
||||
@@ -82,7 +86,8 @@ public sealed class SemVerPrimitiveTests
|
||||
Assert.Equal(">=1.0.0 <2.0.0", rule.Notes);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void ToNormalizedVersionRule_ExactUsesExactValue()
|
||||
{
|
||||
var primitive = new SemVerPrimitive(
|
||||
@@ -106,7 +111,8 @@ public sealed class SemVerPrimitiveTests
|
||||
Assert.Equal("from-ghsa", rule.Notes);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void ToNormalizedVersionRule_GreaterThanMapsMinimum()
|
||||
{
|
||||
var primitive = new SemVerPrimitive(
|
||||
@@ -130,7 +136,8 @@ public sealed class SemVerPrimitiveTests
|
||||
Assert.Null(rule.Notes);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void ToNormalizedVersionRule_UsesConstraintExpressionAsFallbackNotes()
|
||||
{
|
||||
var primitive = new SemVerPrimitive(
|
||||
@@ -148,7 +155,8 @@ public sealed class SemVerPrimitiveTests
|
||||
Assert.Equal("> 1.4.0", rule!.Notes);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void ToNormalizedVersionRule_ExactCarriesConstraintExpressionWhenNotesMissing()
|
||||
{
|
||||
var primitive = new SemVerPrimitive(
|
||||
@@ -169,7 +177,8 @@ public sealed class SemVerPrimitiveTests
|
||||
Assert.Equal("= 3.2.1", rule.Notes);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void ToNormalizedVersionRule_ExplicitNotesOverrideConstraintExpression()
|
||||
{
|
||||
var primitive = new SemVerPrimitive(
|
||||
|
||||
Reference in New Issue
Block a user