From 53913eb6891a71dbdba75010323617eb31547a22 Mon Sep 17 00:00:00 2001 From: Anthonie Kramer Date: Thu, 16 Nov 2023 15:22:48 -0800 Subject: [PATCH] comments --- Elements/test/ModelTests.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Elements/test/ModelTests.cs b/Elements/test/ModelTests.cs index 05b8828b3..c23f02220 100644 --- a/Elements/test/ModelTests.cs +++ b/Elements/test/ModelTests.cs @@ -11,6 +11,7 @@ using Xunit.Abstractions; using Newtonsoft.Json.Linq; using System.Threading.Tasks; +using Microsoft.CodeAnalysis.CSharp.Syntax; namespace Elements.Tests { @@ -219,16 +220,17 @@ public void CoreElementTransformsAreIdempotentDuringSerialization() [Fact] public void SerializationKeepsDiscriminatorOnFallbackBaseElementTypes() { + // Reading in a model with a SpaceBoundary input var json = File.ReadAllText("../../../models/Elements/spaceinputs.json"); var model = Model.FromJson(json); + // Since SpaceBoundary isn't in Elements, it will be deserialized as a `GeometricElement` Assert.True(model.Elements.First().Value.GetType() == typeof(GeometricElement)); var newModel = model.ToJson(); + // When we serialize again, we should still have the discriminator of `Elements.SpaceBoundary` Assert.Contains("Elements.SpaceBoundary", newModel); - - double tt = 0.0; } [Fact]