@@ -2466,6 +2466,126 @@ I am paragraph number three.</summary>
2466
2466
TestWithStrings ( originalIntellisense , originalDocs , expectedDocs , configuration ) ;
2467
2467
}
2468
2468
2469
+ [ Fact ]
2470
+ public void Convert_CodeDataDevCommentType_To_ExpectedElementNames ( )
2471
+ {
2472
+ // The compiled xml files sometimes generate langwords, paramrefs and typeparamrefs with the format
2473
+ // <code data-dev-comment-type="...">...</code>, so we need to convert them to the expected element type.
2474
+
2475
+ string originalIntellisense = @"<?xml version=""1.0""?>
2476
+ <doc>
2477
+ <assembly>
2478
+ <name>MyAssembly</name>
2479
+ </assembly>
2480
+ <members>
2481
+ <member name=""T:MyNamespace.MyType"">
2482
+ <summary>Langword <code data-dev-comment-type=""langword"">true</code>. Paramref <code data-dev-comment-type=""paramref"">myParam</code>. Typeparamref <code data-dev-comment-type=""typeparamref"">myTypeParam</code>.</summary>
2483
+ <remarks>Langword <code data-dev-comment-type=""langword"">true</code>. Paramref <code data-dev-comment-type=""paramref"">myParam</code>. Typeparamref <code data-dev-comment-type=""typeparamref"">myTypeParam</code>.</remarks>
2484
+ </member>
2485
+ </members>
2486
+ </doc>" ;
2487
+
2488
+ string originalDocs = @"<Type Name=""MyType"" FullName=""MyNamespace.MyType"">
2489
+ <TypeSignature Language=""DocId"" Value=""T:MyNamespace.MyType"" />
2490
+ <AssemblyInfo>
2491
+ <AssemblyName>MyAssembly</AssemblyName>
2492
+ </AssemblyInfo>
2493
+ <Docs>
2494
+ <summary>To be added.</summary>
2495
+ <remarks>To be added.</remarks>
2496
+ </Docs>
2497
+ <Members></Members>
2498
+ </Type>" ;
2499
+
2500
+ string expectedDocs = @"<Type Name=""MyType"" FullName=""MyNamespace.MyType"">
2501
+ <TypeSignature Language=""DocId"" Value=""T:MyNamespace.MyType"" />
2502
+ <AssemblyInfo>
2503
+ <AssemblyName>MyAssembly</AssemblyName>
2504
+ </AssemblyInfo>
2505
+ <Docs>
2506
+ <summary>Langword <see langword=""true"" />. Paramref <see paramref=""myParam"" />. Typeparamref <see typeparamref=""myTypeParam"" />.</summary>
2507
+ <remarks>
2508
+ <format type=""text/markdown""><![CDATA[
2509
+
2510
+ ## Remarks
2511
+
2512
+ Langword `true`. Paramref `myParam`. Typeparamref `myTypeParam`.
2513
+
2514
+ ]]></format>
2515
+ </remarks>
2516
+ </Docs>
2517
+ <Members></Members>
2518
+ </Type>" ;
2519
+
2520
+ Configuration configuration = new ( )
2521
+ {
2522
+ MarkdownRemarks = true
2523
+ } ;
2524
+ configuration . IncludedAssemblies . Add ( FileTestData . TestAssembly ) ;
2525
+
2526
+ TestWithStrings ( originalIntellisense , originalDocs , expectedDocs , configuration ) ;
2527
+ }
2528
+
2529
+ [ Fact ]
2530
+ public void Convert_XrefDataThrowIfNotResolved_To_ExpectedElementNames ( )
2531
+ {
2532
+ // The compiled xml files sometimes generate type references with the format
2533
+ // <xref data-throw-if-not-resolved="{bool}" uid="{DocId}"></xref>, so we need to convert them to the expected element type.
2534
+
2535
+ string originalIntellisense = @"<?xml version=""1.0""?>
2536
+ <doc>
2537
+ <assembly>
2538
+ <name>MyAssembly</name>
2539
+ </assembly>
2540
+ <members>
2541
+ <member name=""T:MyNamespace.MyType"">
2542
+ <summary>Type: <xref data-throw-if-not-resolved=""true"" uid=""MyNamespace.MyType""/>.</summary>
2543
+ <remarks>Type: <xref data-throw-if-not-resolved=""true"" uid=""MyNamespace.MyType""></xref>.</remarks>
2544
+ </member>
2545
+ </members>
2546
+ </doc>" ;
2547
+
2548
+ string originalDocs = @"<Type Name=""MyType"" FullName=""MyNamespace.MyType"">
2549
+ <TypeSignature Language=""DocId"" Value=""T:MyNamespace.MyType"" />
2550
+ <AssemblyInfo>
2551
+ <AssemblyName>MyAssembly</AssemblyName>
2552
+ </AssemblyInfo>
2553
+ <Docs>
2554
+ <summary>To be added.</summar
A3E2
y>
2555
+ <remarks>To be added.</remarks>
2556
+ </Docs>
2557
+ <Members></Members>
2558
+ </Type>" ;
2559
+
2560
+ string expectedDocs = @"<Type Name=""MyType"" FullName=""MyNamespace.MyType"">
2561
+ <TypeSignature Language=""DocId"" Value=""T:MyNamespace.MyType"" />
2562
+ <AssemblyInfo>
2563
+ <AssemblyName>MyAssembly</AssemblyName>
2564
+ </AssemblyInfo>
2565
+ <Docs>
2566
+ <summary>Type: <see cref=""T:MyNamespace.MyType"" />.</summary>
2567
+ <remarks>
2568
+ <format type=""text/markdown""><![CDATA[
2569
+
2570
+ ## Remarks
2571
+
2572
+ Type: <xref:MyNamespace.MyType>.
2573
+
2574
+ ]]></format>
2575
+ </remarks>
2576
+ </Docs>
2577
+ <Members></Members>
2578
+ </Type>" ;
2579
+
2580
+ Configuration configuration = new ( )
2581
+ {
2582
+ MarkdownRemarks = true
2583
+ } ;
2584
+ configuration . IncludedAssemblies . Add ( FileTestData . TestAssembly ) ;
2585
+
2586
+ TestWithStrings ( originalIntellisense , originalDocs , expectedDocs , configuration ) ;
2587
+ }
2588
+
2469
2589
private static void TestWithStrings ( string intellisenseFile , string originalDocsFile , string expectedDocsFile , Configuration configuration ) =>
2470
2590
TestWithStrings ( intellisenseFile , new List < StringTestData > ( ) { new StringTestData ( originalDocsFile , expectedDocsFile ) } , configuration ) ;
2471
2591
0 commit comments