Fixed DimAuto and tests

This commit is contained in:
Tig
2024-08-13 14:12:32 -06:00
parent 29dc789d45
commit a8f929bed9
2 changed files with 61 additions and 10 deletions

View File

@@ -216,8 +216,50 @@ public partial class DimAutoTests (ITestOutputHelper output)
MinimumContentDim = 1,
Style = DimAutoStyle.Auto
};
var c = new DimAuto
{
MaximumContentDim = 2,
MinimumContentDim = 1,
Style = DimAutoStyle.Auto
};
var d = new DimAuto
{
MaximumContentDim = null,
MinimumContentDim = 1,
Style = DimAutoStyle.Content
};
var e = new DimAuto
{
MaximumContentDim = null,
MinimumContentDim = 2,
Style = DimAutoStyle.Auto
};
// Test equality with same values
Assert.True (a.Equals (b));
Assert.True (a.GetHashCode () == b.GetHashCode ());
// Test inequality with different MaximumContentDim
Assert.False (a.Equals (c));
Assert.False (a.GetHashCode () == c.GetHashCode ());
// Test inequality with different Style
Assert.False (a.Equals (d));
Assert.False (a.GetHashCode () == d.GetHashCode ());
// Test inequality with different MinimumContentDim
Assert.False (a.Equals (e));
Assert.False (a.GetHashCode () == e.GetHashCode ());
// Test equality with self
Assert.True (a.Equals (a));
Assert.True (a.GetHashCode () == a.GetHashCode ());
// Test inequality with null
Assert.False (a.Equals (null));
}
[Fact]