Tests: the gear schematic fixture reveals the hull as the claim tests do; drop the formatting probe
The Format probe showed a Reveal formats as "Reveal" (no graph walk), so no ToString and no test is added (follow-up bearing-markers-test-residuals (2)). Builds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5659bcfdd0
commit
9b28daf7eb
2 changed files with 5 additions and 21 deletions
|
|
@ -1729,22 +1729,6 @@ public sealed partial class ContactRevealTests : IDisposable
|
|||
Assert.Equal(hostile, o.IsHostileTo(e));
|
||||
}
|
||||
|
||||
// A failing assertion over a Reveal formats the value for its message: if that walked the Entity graph the message would be
|
||||
// enormous or the host would die on it. Probe of follow-up bearing-markers-test-residuals (2).
|
||||
[Fact]
|
||||
public void AFailingRevealAssertionFormatsBriefly()
|
||||
{
|
||||
var e = Add(float3(30, 0, 40), new[] { "Gun" });
|
||||
var o = Add(float3(0, 0, 0), new[] { "Eye" });
|
||||
Fire(e, Guns(e)[0]);
|
||||
var reveal = Assert.Single(o.RevealsOf(e));
|
||||
|
||||
var text = Xunit.Sdk.ArgumentFormatter.Format(reveal);
|
||||
|
||||
Assert.True(text.Length < 400, $"formatted length {text.Length}");
|
||||
Assert.Contains("Gun", text);
|
||||
}
|
||||
|
||||
private static int PaintInbox(Entity e) => ((System.Collections.ICollection) typeof(Entity).GetField("_paintInbox", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(e)).Count;
|
||||
|
||||
// A paint still unpublished in an observer's inbox when the observer leaves the zone is gone: it does not arrive as a
|
||||
|
|
|
|||
|
|
@ -399,19 +399,19 @@ public sealed partial class ContactRevealTests
|
|||
[Fact]
|
||||
public void AFinishedScanListsTheGearOnTheSchematic()
|
||||
{
|
||||
var target = Add(float3(0, 0, 100), new[] { "Gun" }, new[] { "Reactor", "Radiator", "SuppressorCold" });
|
||||
var target = Add(float3(30, 0, 40), new[] { "Gun" }, new[] { "Reactor", "Radiator", "SuppressorCold" });
|
||||
var s = Add(float3(0, 0, 0), new[] { "Eye" }, new[] { "Scanner" });
|
||||
s.EntityInfoGathered[target] = .5f;
|
||||
s.SetTarget(target);
|
||||
var fitted = FittedBesidesTheHull(target);
|
||||
var gun = Guns(target)[0];
|
||||
var reactor = target.Equipment.Where(i => i.Behaviors.Any(b => b is Reactor)).Last();
|
||||
target.Claim(reactor, DataOf("Radiator"));
|
||||
target.SetSignature(new object(), SignatureChannel.LaunchFlash, 1000000f, target.EquippedHull);
|
||||
Hold(s, 1, target);
|
||||
Tick(.1f);
|
||||
Assert.Equal(target.EquippedHull, Assert.Single(s.RevealsOf(target)).Item); // fixture: the hull is in the book, as a hull class
|
||||
Assert.IsAssignableFrom<HullData>(s.RevealsOf(target).Single().Claimed);
|
||||
Hold(s, 14, target);
|
||||
s.EntityInfoGathered[target] = .5f;
|
||||
s.SetTarget(target);
|
||||
Hold(s, 15, target);
|
||||
Assert.Empty(s.SchematicRows(target)); // fixture: no row before the scan is done
|
||||
|
||||
Hold(s, 1, target);
|
||||
|
|
|
|||
Loading…
Reference in a new issue