Resolve Eve surface pointer refs generically
This commit is contained in:
parent
be9bffab4d
commit
857e404f5a
3 changed files with 70 additions and 6 deletions
|
|
@ -406,6 +406,43 @@ public class DaemonRuntimeDocumentTests
|
|||
AetheriaRuntimeDaemonStateRefs.CurrentTargetName));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void EveSurfaceAdapterResolvesTypedPointerPropsBeforeLowering()
|
||||
{
|
||||
var surface = new EveSurfaceDocument(
|
||||
"surface-state",
|
||||
"gamecult.eve.surface.v1",
|
||||
"aetheria.daemon",
|
||||
"daemon",
|
||||
"Daemon",
|
||||
1,
|
||||
"",
|
||||
new EveSurfaceTree(
|
||||
"aetheria.test.surface",
|
||||
new EveSurfaceComponent(
|
||||
"aetheria.test.metric",
|
||||
"metric",
|
||||
new Dictionary<string, string>(StringComparer.Ordinal)
|
||||
{
|
||||
["label"] = "Heat",
|
||||
["description"] = "stale",
|
||||
["descriptionRef"] = AetheriaRuntimeDaemonStateRefs.CurrentTargetName,
|
||||
[AetheriaRuntimeSurfaceStateRefs.Value] = AetheriaRuntimeDaemonStateRefs.CurrentTargetName
|
||||
},
|
||||
Array.Empty<EveSurfaceComponent>()),
|
||||
Array.Empty<EveStyleToken>()),
|
||||
Array.Empty<EveCommandTemplate>());
|
||||
|
||||
var resolved = AetheriaRuntimeEveSurfaceAdapter.ResolveStateRefs(
|
||||
surface,
|
||||
stateRef => stateRef == AetheriaRuntimeDaemonStateRefs.CurrentTargetName ? "Live Target" : "");
|
||||
|
||||
Assert.IsTrue(ContainsEveSurfaceProp(resolved.Surface.Root, "description", "Live Target"));
|
||||
Assert.IsTrue(ContainsEveSurfaceProp(resolved.Surface.Root, "descriptionRef", AetheriaRuntimeDaemonStateRefs.CurrentTargetName));
|
||||
Assert.IsTrue(ContainsEveSurfaceProp(resolved.Surface.Root, "value", "Live Target"));
|
||||
Assert.IsTrue(ContainsEveSurfaceProp(resolved.Surface.Root, AetheriaRuntimeSurfaceStateRefs.Value, AetheriaRuntimeDaemonStateRefs.CurrentTargetName));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RuntimeStateReaderResolvesItemStatRefsFromDaemonFrame()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue