|
1 | 1 | // Licensed to the .NET Foundation under one or more agreements.
|
2 | 2 | // The .NET Foundation licenses this file to you under the MIT license.
|
3 | 3 |
|
| 4 | +using System; |
4 | 5 | using System.Collections.Generic;
|
5 | 6 | using System.Text;
|
6 | 7 | using System.Xml.Linq;
|
@@ -2466,6 +2467,67 @@ I am paragraph number three.</summary>
|
2466 | 2467 | TestWithStrings(originalIntellisense, originalDocs, expectedDocs, configuration);
|
2467 | 2468 | }
|
2468 | 2469 |
|
| 2470 | + [Fact] |
| 2471 | + public void Para_EdgeCases() |
| 2472 | + { |
| 2473 | + // Convert triple slash new lines to para xml items. If there are paras too, keep them. |
| 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><para>I am paragraph one with pre-existing paras.</para> |
| 2483 | +I am paragraph number two but I am |
| 2484 | +divided into two lines. I am paragraph three but I am in the same line, my spacing between lines should be ignored |
| 2485 | + and the next newlines should be ignored. |
| 2486 | +
|
| 2487 | +
|
| 2488 | + <para>I am the fourth paragraph with pre-existing paras.</para> |
| 2489 | +</summary> |
| 2490 | + </member> |
| 2491 | + </members> |
| 2492 | +</doc>"; |
| 2493 | + |
| 2494 | + string originalDocs = @"<Type Name=""MyType"" FullName=""MyNamespace.MyType""> |
| 2495 | + <TypeSignature Language=""DocId"" Value=""T:MyNamespace.MyType"" /> |
| 2496 | + <AssemblyInfo> |
| 2497 | + <AssemblyName>MyAssembly</AssemblyName> |
| 2498 | + </AssemblyInfo> |
| 2499 | + <Docs> |
| 2500 | + <summary>To be added.</summary> |
| 2501 | + <remarks>To be added.</remarks> |
| 2502 | + </Docs> |
| 2503 | + <Members></Members> |
| 2504 | +</Type>"; |
| 2505 | + |
| 2506 | + string expectedDocs = @"<Type Name=""MyType"" FullName=""MyNamespace.MyType""> |
| 2507 | + <TypeSignature Language=""DocId"" Value=""T:MyNamespace.MyType"" /> |
| 2508 | + <AssemblyInfo> |
| 2509 | + <AssemblyName>MyAssembly</AssemblyName> |
| 2510 | + </AssemblyInfo> |
| 2511 | + <Docs> |
| 2512 | + <summary> |
| 2513 | + <para>I am paragraph one with pre-existing paras.</para> |
| 2514 | + <para>I am paragraph number two but I am divided into two lines. I am paragraph three but I am in the same line, my spacing between lines should be ignored and the next newlines should be ignored.</para> |
| 2515 | + <para>I am the fourth paragraph with pre-existing paras.</para> |
| 2516 | + </summary> |
| 2517 | + <remarks>To be added.</remarks> |
| 2518 | + </Docs> |
| 2519 | + <Members></Members> |
| 2520 | +</Type>"; |
| 2521 | + |
| 2522 | + Configuration configuration = new() |
| 2523 | + { |
| 2524 | + MarkdownRemarks = true |
| 2525 | + }; |
| 2526 | + configuration.IncludedAssemblies.Add(FileTestData.TestAssembly); |
| 2527 | + |
| 2528 | + TestWithStrings(originalIntellisense, originalDocs, expectedDocs, configuration); |
| 2529 | + } |
| 2530 | + |
2469 | 2531 | [Fact]
|
2470 | 2532 | public void Convert_CodeDataDevCommentType_To_ExpectedElementNames()
|
2471 | 2533 | {
|
@@ -2619,6 +2681,4 @@ private static void TestWithStrings(List<string> intellisenseFiles, List<StringT
|
2619 | 2681 | }
|
2620 | 2682 | }
|
2621 | 2683 | }
|
2622 |
| - |
2623 |
| - |
2624 | 2684 | }
|
0 commit comments