Code review on commit 7fd9c82 flagged that the test asserted NearRadius,
FarRadius, CenterX, CenterY but not the load-bearing alias
Radius == FarRadius. That alias is what makes the existing hysteresis
math (Radius+2 unload threshold) correctly target the far-tier boundary.
Future typos would silently break far-tier hysteresis.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
23 lines
872 B
C#
23 lines
872 B
C#
using AcDream.App.Streaming;
|
|
using Xunit;
|
|
|
|
namespace AcDream.Core.Tests.Streaming;
|
|
|
|
public class StreamingRegionTwoTierTests
|
|
{
|
|
[Fact]
|
|
public void Constructor_TwoRadii_ExposesNearAndFarRadii()
|
|
{
|
|
var region = new StreamingRegion(centerX: 100, centerY: 100, nearRadius: 4, farRadius: 12);
|
|
|
|
Assert.Equal(4, region.NearRadius);
|
|
Assert.Equal(12, region.FarRadius);
|
|
Assert.Equal(100, region.CenterX);
|
|
Assert.Equal(100, region.CenterY);
|
|
// Radius (used by existing single-radius hysteresis math) must alias to
|
|
// FarRadius — the outer ring drives "everything currently loaded" bookkeeping.
|
|
// If a future change mistakenly aliases Radius to NearRadius, hysteresis
|
|
// becomes (NearRadius+2) for the far-tier unload, which is wrong.
|
|
Assert.Equal(region.FarRadius, region.Radius);
|
|
}
|
|
}
|