From 46ab2971ac8f941c63c4bdd99f2ab5578b6ef1c1 Mon Sep 17 00:00:00 2001 From: filzrev <103790468+filzrev@users.noreply.github.com> Date: Fri, 27 Sep 2024 07:38:56 +0900 Subject: [PATCH] chore: add ManagedReference YAML roundtrip tests --- src/Docfx.Common/Json/JsonUtility.cs | 3 +++ .../YamlSerializationTest.ManagedReference.cs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Docfx.Common/Json/JsonUtility.cs b/src/Docfx.Common/Json/JsonUtility.cs index 75bf4e427ce..279a1b32a9c 100644 --- a/src/Docfx.Common/Json/JsonUtility.cs +++ b/src/Docfx.Common/Json/JsonUtility.cs @@ -94,6 +94,9 @@ private static bool IsSupported() case "Docfx.DataContracts.ManagedReference.PageViewModel": return true; + case "Docfx.DataContracts.ManagedReference.PageViewModel": + return false; // TODO: Need to support ExtensionData + // Intermediate types for tests. it's expected to be removed later (And return true by default). case "Docfx.Plugins.MarkdownServiceProperties": return true; diff --git a/test/docfx.Tests/SerializationTests/YamlSerializationTest.ManagedReference.cs b/test/docfx.Tests/SerializationTests/YamlSerializationTest.ManagedReference.cs index 3012c8a890f..bbdb31da56b 100644 --- a/test/docfx.Tests/SerializationTests/YamlSerializationTest.ManagedReference.cs +++ b/test/docfx.Tests/SerializationTests/YamlSerializationTest.ManagedReference.cs @@ -18,7 +18,7 @@ public void YamlSerializationTest_ManagedReference(string path) var model = TestData.Load(path); // Act/Assert - ValidateYamlRoundTrip(model); ValidateYamlJsonRoundTrip(model); + ValidateYamlRoundTripWithJson(model); } }