Skip to content

Commit 49ac615

Browse files
committed
Adjust and update tests
1 parent fb11e70 commit 49ac615

File tree

4 files changed

+17
-21
lines changed

4 files changed

+17
-21
lines changed

src/PortToTripleSlash/tests/PortToTripleSlash/PortToTripleSlash.Strings.Tests.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,12 +1320,12 @@ public MyClass() { }
13201320
{
13211321
// Comment on top of type
13221322
/// <summary>This is the MyClass type summary.</summary>" +
1323-
GetRemarks(skipRemarks, "MyClass type", " ") +
1323+
GetRemarks(skipRemarks, "MyClass type", " ") +
13241324
@" public class MyClass
13251325
{
13261326
// Comment on top of constructor
13271327
/// <summary>This is the MyClass constructor summary.</summary>" +
1328-
GetRemarks(skipRemarks, "MyClass constructor", " ") +
1328+
GetRemarks(skipRemarks, "MyClass constructor", " ") +
13291329
@" public MyClass() { }
13301330
}
13311331
}";
@@ -1338,7 +1338,6 @@ public MyClass() { }
13381338
return TestWithStringsAsync(data, skipRemarks);
13391339
}
13401340

1341-
[ActiveIssue("https://github.com/dotnet/api-docs-sync/issues/149")]
13421341
[Theory]
13431342
[InlineData(false)]
13441343
[InlineData(true)]

src/PortToTripleSlash/tests/PortToTripleSlash/TestData/Basic/SourceExpected.cs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
using System;
1+
using System;
22

33
namespace MyNamespace
44
{
5-
/// <summary>This is the MyEnum enum summary.</summary>
6-
/// <remarks><format type="text/markdown"><![CDATA[
7-
/// These are the <xref:MyNamespace.MyEnum> enum remarks. They contain an [!INCLUDE[MyInclude](~/includes/MyInclude.md)] which should prevent converting markdown to xml.
8-
/// URL entities: %23%28%2C%29 must remain unconverted.
9-
/// ]]></format></remarks>
105
// Original MyEnum enum comments with information for maintainers, must stay.
6+
/// <summary>This is the MyEnum enum summary.</summary>
7+
/// <remarks>These are the <see cref="MyNamespace.MyEnum" /> enum remarks. They contain an [!INCLUDE[MyInclude](~/includes/MyInclude.md)] which should prevent converting markdown to xml.
8+
/// URL entities: %23%28%2C%29 must remain unconverted.</remarks>
119
public enum MyEnum
1210
{
1311
/// <summary>This is the MyEnumValue0 member summary. There is no public modifier.</summary>
@@ -17,6 +15,7 @@ public enum MyEnum
1715
MyEnumValue1 = 1
1816
}
1917

18+
// Original MyType class comments with information for maintainers, must stay.
2019
/// <summary>This is the MyType class summary.</summary>
2120
/// <remarks>These are the <see cref="MyNamespace.MyType" /> class remarks.
2221
/// URL entities: #(),.
@@ -27,12 +26,11 @@ public enum MyEnum
2726
/// ]]></format>
2827
/// This text is not a note. It has a <see cref="MyNamespace.MyType" /> that should be xml and outside <b>the cdata</b>.
2928
/// Long xrefs one after the other: <see cref="System.IO.Pipelines.PipeWriter.FlushAsync(System.Threading.CancellationToken)" /> or <see cref="System.IO.Pipelines.PipeWriter.WriteAsync(System.ReadOnlyMemory{byte},System.Threading.CancellationToken)" /> should both be converted to crefs.</remarks>
30-
// Original MyType class comments with information for maintainers, must stay.
3129
public class MyType
3230
{
33-
/// <summary>This is the MyType constructor summary.</summary>
3431
// Original MyType constructor double slash comments on top of triple slash, with information for maintainers, must stay but after triple slash.
3532
// Original MyType constructor double slash comments on bottom of triple slash, with information for maintainers, must stay.
33+
/// <summary>This is the MyType constructor summary.</summary>
3634
public MyType()
3735
{
3836
} /* Trailing comments should remain untouched */
@@ -51,12 +49,12 @@ internal MyType(int myProperty)
5149
// Double slash comments above private members should remain untouched.
5250
private int _myProperty;
5351

52+
// Original MyProperty property double slash comments with information for maintainers, must stay.
53+
// This particular example has two rows of double slash comments and both should stay.
5454
/// <summary>This is the MyProperty summary.</summary>
5555
/// <value>This is the MyProperty value.</value>
5656
/// <remarks>These are the MyProperty remarks.
5757
/// Multiple lines and a reference to the field <see cref="MyNamespace.MyType.MyField" /> and the xref uses displayProperty, which should be ignored when porting.</remarks>
58-
// Original MyProperty property double slash comments with information for maintainers, must stay.
59-
// This particular example has two rows of double slash comments and both should stay.
6058
public int MyProperty
6159
{
6260
get { return _myProperty; /* Internal comments should remain untouched. */ }
@@ -139,6 +137,7 @@ public void MyTypeParamMethod<T>(int param1)
139137
{
140138
}
141139

140+
// Original MyDelegate delegate comments with information for maintainers, must stay.
142141
/// <summary>This is the MyDelegate summary.</summary>
143142
/// <param name="sender">This is the sender parameter.</param>
144143
/// <remarks>These are the <see cref="MyNamespace.MyType.MyDelegate" /> remarks. There is a code example, which should be moved to its own examples section:</remarks>
@@ -153,18 +152,17 @@ public void MyTypeParamMethod<T>(int param1)
153152
/// <seealso cref="System.Delegate"/>
154153
/// <altmember cref="System.Delegate"/>
155154
/// <related type="Article" href="https://github.com/dotnet/runtime">The .NET Runtime repo.</related>
156-
// Original MyDelegate delegate comments with information for maintainers, must stay.
157155
public delegate void MyDelegate(object sender);
158156

159157
/// <summary>This is the MyEvent summary.</summary>
160158
public event MyDelegate MyEvent;
161159

160+
// Original operator + method comments with information for maintainers, must stay.
162161
/// <summary>Adds two MyType instances.</summary>
163162
/// <param name="value1">The first type to add.</param>
164163
/// <param name="value2">The second type to add.</param>
165164
/// <returns>The added types.</returns>
166165
/// <remarks>These are the <see cref="MyNamespace.MyType.op_Addition(MyNamespace.MyType,MyNamespace.MyType)" /> remarks. They are in plain xml and should be transferred unmodified.</remarks>
167-
// Original operator + method comments with information for maintainers, must stay.
168166
public static MyType operator +(MyType value1, MyType value2) => value1;
169167
}
170168
}

src/PortToTripleSlash/tests/PortToTripleSlash/TestData/Generics/MyGenericType`1.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
<Type Name="MyGenericType&lt;T&gt;" FullName="MyNamespace.MyGenericType&lt;T&gt;">
1+
<Type Name="MyGenericType&lt;T&gt;" FullName="MyNamespace.MyGenericType&lt;T&gt;">
22
<TypeSignature Language="DocId" Value="T:MyNamespace.MyGenericType`1" />
33
<AssemblyInfo>
44
<AssemblyName>MyAssembly</AssemblyName>
55
</AssemblyInfo>
66
<Docs>
77
<summary>This is the MyGenericType{T} class summary.</summary>
88
<remarks>
9-
<format type="text/markdown">
10-
<![CDATA[
9+
<format type="text/markdown"><![CDATA[
1110
## Remarks
1211
Contains the nested class <xref:MyNamespace.MyGenericType%601.Enumerator>.
1312
]]></format>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
using System;
1+
using System;
22

33
namespace MyNamespace
44
{
5+
// Original MyGenericType<T> class comments with information for maintainers, must stay.
56
/// <summary>This is the MyGenericType{T} class summary.</summary>
67
/// <remarks>Contains the nested class <see cref="MyNamespace.MyGenericType{T}.Enumerator" />.</remarks>
7-
// Original MyGenericType<T> class comments with information for maintainers, must stay.
88
public class MyGenericType<T>
99
{
10-
/// <summary>This is the MyGenericType{T}.Enumerator class summary.</summary>
1110
// Original MyGenericType<T>.Enumerator class comments with information for maintainers, must stay.
11+
/// <summary>This is the MyGenericType{T}.Enumerator class summary.</summary>
1212
public class Enumerator { }
1313
}
1414
}

0 commit comments

Comments
 (0)