Skip to content

Commit b675e83

Browse files
committed
Validate element types
1 parent 6087c71 commit b675e83

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Tests/Tests.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,23 @@ private static void Validate_Vmap_Reflection(Datamodel.Datamodel unserialisedVma
329329

330330
Assert.That(unserialisedVmap.PrefixAttributes["map_asset_references"], Is.Not.Empty);
331331

332+
// iterate all datamodel elements, and verify that all their types are superclasses of Element
333+
foreach (var elem in unserialisedVmap.AllElements)
334+
{
335+
if (elem.Name == "subdivisionBinding")
336+
{
337+
continue; // known case, skip
338+
}
339+
340+
// prefix elements, still an Element type
341+
if (elem.ContainsKey("map_asset_references"))
342+
{
343+
continue;
344+
}
345+
346+
Assert.That(elem, Is.Not.TypeOf<Element>(), $"Found object {elem.ID} {elem.ClassName} that is still an Element type.");
347+
}
348+
332349
}
333350

334351
[Test]

0 commit comments

Comments
 (0)