From b6075b776f10c7b685ef3a2707d8051c5ebe5622 Mon Sep 17 00:00:00 2001
From: Meta Vens
Date: Sun, 18 Oct 2026 10:27:46 +0200
Subject: [PATCH] Tier and wear tests pin the tolerance, the upgrade steps and
the direction of the quality term
Kills the Stryker survivors in the lines this cut touches that a quality-reading test can reach. Builds.
Co-Authored-By: Claude Sonnet 5.5
---
tests/Aetheria.Shared.Tests/HeatResponseTests.cs | 3 ++-
tests/Aetheria.Shared.Tests/LoadoutTests.cs | 7 +++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/tests/Aetheria.Shared.Tests/HeatResponseTests.cs b/tests/Aetheria.Shared.Tests/HeatResponseTests.cs
index 6f1f768ee..2873fc743 100644
--- a/tests/Aetheria.Shared.Tests/HeatResponseTests.cs
+++ b/tests/Aetheria.Shared.Tests/HeatResponseTests.cs
@@ -250,7 +250,7 @@ public sealed class HeatResponseTests : IDisposable
}
// Wear's quality term reads the lot's effective quality: a .9 lot whose one part is .1 wears as a roleless .1 lot, and not
- // as a roleless .9 lot.
+ // as a roleless .9 lot, which wears less (better quality wears less).
[Fact]
public void HeldOutsidePlateauWearReadsEffectiveQuality()
{
@@ -267,6 +267,7 @@ public sealed class HeatResponseTests : IDisposable
var sleeper = WearAt10(Gear(.9f, .1f));
Assert.Equal(WearAt10(Gear(.1f)), sleeper, 5);
Assert.NotEqual(WearAt10(Gear(.9f)), sleeper, 5);
+ Assert.True(WearAt10(Gear(.9f)) < sleeper);
}
[Fact]
diff --git a/tests/Aetheria.Shared.Tests/LoadoutTests.cs b/tests/Aetheria.Shared.Tests/LoadoutTests.cs
index 3280f3fbf..8abac0171 100644
--- a/tests/Aetheria.Shared.Tests/LoadoutTests.cs
+++ b/tests/Aetheria.Shared.Tests/LoadoutTests.cs
@@ -527,9 +527,12 @@ public sealed class LoadoutTests : IDisposable
Quality = .6f,
Roles = new List { new RoleFill { Role = "lens", Quality = .3f } }
});
+ // Just under the Rare threshold, inside GetTier's .001 tolerance.
+ var nearRareLot = items.Lots.Add(new Lot { Design = cache.RefOf(lamp), Origin = new Attributed(), Quality = .4995f, Roles = new List() });
var instance = (EquippableItem) items.CreateInstance(commonLot);
var rareInstance = (EquippableItem) items.CreateInstance(rareLot);
var cappedInstance = (EquippableItem) items.CreateInstance(cappedLot);
+ var nearRareInstance = (EquippableItem) items.CreateInstance(nearRareLot);
var withRole = new PerformanceStat { Min = 0, Max = 1, Terms = { new StatTerm { Source = StatSource.Quality, Exponent = 1, Role = "lens" } } };
var noRole = new PerformanceStat { Min = 0, Max = 1, Terms = { new StatTerm { Source = StatSource.Quality, Exponent = 1 } } };
@@ -538,6 +541,10 @@ public sealed class LoadoutTests : IDisposable
Assert.Equal(.2f, items.GetTier(instance).tier.Quality, 3);
Assert.Equal(.5f, items.GetTier(rareInstance).tier.Quality, 3);
Assert.Equal(.2f, items.GetTier(cappedInstance).tier.Quality, 3);
+ Assert.Equal(.5f, items.GetTier(nearRareInstance).tier.Quality, 3);
+ // Upgrades count the steps of .05 above the tier: the capped lot's effective .3 is two above Common's .2.
+ Assert.Equal(2, items.GetTier(cappedInstance).upgrades);
+ Assert.Equal(0, items.GetTier(instance).upgrades);
// Minting a second instance from an existing lot must not re-roll the lot's quality.
var secondInstance = (EquippableItem) items.CreateInstance(commonLot);