Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonie-kramer committed Nov 16, 2023
1 parent d27bc93 commit 53913eb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Elements/test/ModelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using Xunit.Abstractions;
using Newtonsoft.Json.Linq;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CSharp.Syntax;

namespace Elements.Tests
{
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit 53913eb

Please sign in to comment.