Skip to content

Commit 80d10a7

Browse files
committed
chore: add BuildJsonConfig JSON roundtrip test
1 parent b8e4d85 commit 80d10a7

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed

src/Docfx.Common/Json/JsonUtility.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ private static bool IsSupported()
9090
switch (fullName)
9191
{
9292
// TODO: Return `true` for types that support serialize/deserializenon with System.Text.Json.
93+
case "Docfx.BuildJsonConfig":
9394
case "Docfx.MergeJsonConfig":
9495

9596
case "Docfx.Build.Engine.XRefMap":
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using Docfx;
5+
using Docfx.Common;
6+
using FluentAssertions;
7+
8+
namespace docfx.Tests;
9+
10+
public partial class JsonSerializationTest
11+
{
12+
[Theory]
13+
[TestData<BuildJsonConfig>]
14+
public void JsonSerializationTest_BuildJsonConfig(string path)
15+
{
16+
// Arrange
17+
var model = TestData.Load<BuildJsonConfig>(path);
18+
19+
// Act/Assert
20+
ValidateJsonRoundTrip(model);
21+
}
22+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"content": [
3+
{
4+
"files": [ "**/*.{md,yml}" ],
5+
"exclude": [ "_site/**", "obj/**" ]
6+
}
7+
],
8+
"resource": [
9+
{
10+
"files": [ "**/images/**", "**/media/**", "codesnippet/**" ],
11+
"exclude": [ "_site/**", "obj/**" ]
12+
}
13+
],
14+
"postProcessors": [ "ExtractSearchIndex" ],
15+
"globalMetadata": {
16+
"_appTitle": "docfx",
17+
"_appName": "docfx",
18+
"_appFooter": "<span>Supported by the <a href=\"https://dotnetfoundation.org\">.NET Foundation</a>. Made with <a href=\"https://dotnet.github.io/docfx\">docfx</a></span>",
19+
"_googleAnalyticsTagId": "G-Q5N6XJHEX5",
20+
"pdf": true
21+
},
22+
"markdownEngineProperties": {
23+
"alerts": {
24+
"TODO": "alert alert-secondary"
25+
}
26+
},
27+
"sitemap": {
28+
"baseUrl": "https://dotnet.github.io/docfx",
29+
"priority": 0.5,
30+
"changefreq": "daily"
31+
},
32+
"xref": [
33+
"../.xrefmap.json"
34+
],
35+
"output": "_site",
36+
"template": [
37+
"default",
38+
"modern",
39+
"template"
40+
]
41+
}

0 commit comments

Comments
 (0)