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 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-18 10:27:46 +02:00
commit b6075b776f
2 changed files with 9 additions and 1 deletions

View file

@ -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]

View file

@ -527,9 +527,12 @@ public sealed class LoadoutTests : IDisposable
Quality = .6f,
Roles = new List<RoleFill> { 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<ItemData>(lamp), Origin = new Attributed(), Quality = .4995f, Roles = new List<RoleFill>() });
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);