using XFEEDToolBox.Core.Galaxy; using XFEEDToolBox.Core.Models; using XFEExtension.NetCore.XUnit.Attributes; namespace XFEEDToolBox.Test; [TestFixture] public class GalaxyForcedPointLodTests { private static readonly GalacticSystem Published=new("Published policy fixture",new(0,0,0),1,"G"); private static GalaxyCatalogueSelection Selection()=>new(GalaxyOriginalCatalogueLod.Create(new(1000,0,1000),1,32,.001,1,0),new(0,0,0)) {PointOverrides=new(42,1,0,0,true,false,[new(1,1,false,false,Published.Position,Published.Name,"G",null)],[])}; [Test] public void AKindZeroPublishedPointInTheMiddleOfAnOverflowingTileReservesItsOwnBudgetSlot() { const int count=10000,index=123,budget=64; var selection=Selection();var filter=new GalaxyMapFilter{Mode=GalaxyMapMode.Map,Category=GalaxyFilterCategory.StarClass,Values=new HashSet{"g"}}; Check.That(selection.IsForced(Published)&&filter.Matches(Published)); var priority=GalaxyMapLod.IsPriority(Published,selection,filter.Matches(Published),retainedMarker:false);Check.That(priority); // Confirm that this interior source-order point is dropped by ordinary // fair sampling; a last-row fixture would always be sampled anyway. var baseline=new GalaxyMapLod();baseline.Begin(1000,800,budget); for(var i=0;i{"k"}}; Check.That(selection.Contains(Published)&&!negative.Matches(Published)); Check.That(!GalaxyMapLod.IsPriority(Published,selection,negative.Matches(Published))); Check.That(!GalaxyMapLod.IsPriority(Published,selection,false,retainedMarker:true)); Check.That(!GalaxyMapLod.IsPriority(Published with{Position=new(1,0,0)},selection,true)); Check.That(!GalaxyMapLod.IsPriority(Published with{SystemAddress=2},selection,true)); Check.That(!GalaxyMapLod.IsPriority(Published,selection with{PointOverrides=null},true)); Check.That(!GalaxyMapLod.IsPriority(Published,null,true)); Check.That(GalaxyMapLod.IsPriority(Published,null,true,retainedMarker:true)); // Pending=false is a consumed publication, not lost priority; neither // changing kind nor creating a navigation marker is required. Check.That(selection.PointOverrides!.Overrides[1].Pending==false&&GalaxyMapLod.IsPriority(Published,selection,true)); } }