@@ -5,30 +5,32 @@ class MyClass
5
5
/// <summary>
6
6
/// This is testing property from MyClass.
7
7
/// </summary>
8
- public virtual int TestPropertyFromMyClass { get ; set ; }
8
+ public virtual int MyProperty { get ; set ; }
9
9
}
10
10
11
11
class MyInheritedClass : MyClass
12
12
{
13
13
/// <inheritdoc />
14
- public override int TestPropertyFromMyClass { get ; set ; }
14
+ public override int MyProperty { get ; set ; }
15
15
16
16
17
17
/// <summary>
18
18
/// This is testing property from inherited class.
19
19
/// </summary>
20
- public int TestPropertyFromMyInheritedClass { get ; set ; }
20
+ public int AnotherProperty { get ; set ; }
21
21
}
22
22
23
23
class MyDoubleInheritedClass : MyInheritedClass
24
24
{
25
25
/// <inheritdoc />
26
- public override int TestPropertyFromMyClass { get ; set ; }
26
+ public override int MyProperty { get ; set ; }
27
27
}
28
28
29
29
class MySimpleClass
30
30
{
31
31
public int MyMethod ( ) => 1 ;
32
+
33
+ public int MyMethod ( int x ) => x + 1 ;
32
34
}
33
35
34
36
public class PlainTextRendererEndToEndTests
@@ -37,11 +39,11 @@ public class PlainTextRendererEndToEndTests
37
39
private const string ThisIsTestingPropertyFromInheritedClass = "This is testing property from inherited class." ;
38
40
39
41
[ Fact ]
40
- public void Render_ExtractsPropertySummary_ForMyInheritedClassReturnXmlCommentFromMyClass ( )
42
+ public void ToPlainText_MyPropertyFromMyInheritedClass_ReturnsThisIsTestingPropertyFromMyClass ( )
41
43
{
42
44
// Arrange
43
45
var xdoc = new XDoc ( ) ;
44
- var propertyInfo = typeof ( MyInheritedClass ) . GetProperty ( nameof ( MyInheritedClass . TestPropertyFromMyClass ) ) ;
46
+ var propertyInfo = typeof ( MyInheritedClass ) . GetProperty ( nameof ( MyInheritedClass . MyProperty ) ) ;
45
47
46
48
// Act
47
49
var propertyDocumentation = xdoc . Get ( propertyInfo ) ;
@@ -52,12 +54,11 @@ public void Render_ExtractsPropertySummary_ForMyInheritedClassReturnXmlCommentFr
52
54
}
53
55
54
56
[ Fact ]
55
- public void Render_ExtractsPropertySummary_ForMyDoubleInheritedClassReturnXmlCommentFromMyClass ( )
57
+ public void ToPlainText_MyPropertyFromMyDoubleInheritedClass_ReturnsThisIsTestingPropertyFromMyClass ( )
56
58
{
57
59
// Arrange
58
60
var xdoc = new XDoc ( ) ;
59
- var propertyInfo =
60
- typeof ( MyDoubleInheritedClass ) . GetProperty ( nameof ( MyDoubleInheritedClass . TestPropertyFromMyClass ) ) ;
61
+ var propertyInfo = typeof ( MyDoubleInheritedClass ) . GetProperty ( nameof ( MyDoubleInheritedClass . MyProperty ) ) ;
61
62
62
63
// Act
63
64
var propertyDocumentation = xdoc . Get ( propertyInfo ) ;
@@ -68,11 +69,11 @@ public void Render_ExtractsPropertySummary_ForMyDoubleInheritedClassReturnXmlCom
68
69
}
69
70
70
71
[ Fact ]
71
- public void Render_ExtractsPropertySummary_ForMyInheritedClassReturnXmlCommentFromMyInheritedClass ( )
72
+ public void ToPlainText_AnotherPropertyFromMyInheritedClass_ReturnsThisIsTestingPropertyFromInheritedClass ( )
72
73
{
73
74
// Arrange
74
75
var xdoc = new XDoc ( ) ;
75
- var propertyInfo = typeof ( MyInheritedClass ) . GetProperty ( nameof ( MyInheritedClass . TestPropertyFromMyInheritedClass ) ) ;
76
+ var propertyInfo = typeof ( MyInheritedClass ) . GetProperty ( nameof ( MyInheritedClass . AnotherProperty ) ) ;
76
77
77
78
// Act
78
79
var propertyDocumentation = xdoc . Get ( propertyInfo ) ;
@@ -83,26 +84,26 @@ public void Render_ExtractsPropertySummary_ForMyInheritedClassReturnXmlCommentFr
83
84
}
84
85
85
86
[ Fact ]
86
- public void Render_ExtractsPropertySummary_ForMySimpleClassReturnEmpty ( )
87
+ public void ToPlainText_MyMethodFromMySimpleClass_ReturnsEmptyString ( )
87
88
{
88
89
// Arrange
89
90
var xdoc = new XDoc ( ) ;
90
- var methodInfo = typeof ( MySimpleClass ) . GetMethod ( nameof ( MySimpleClass . MyMethod ) ) ;
91
+ var methodInfo = typeof ( MySimpleClass ) . GetMethod ( nameof ( MySimpleClass . MyMethod ) , [ typeof ( int ) ] ) ! ;
91
92
92
93
// Act
93
94
var methodocumentation = xdoc . Get ( methodInfo ) ;
94
95
var xmlComment = methodocumentation . ToPlainText ( ) ;
95
96
96
97
// Assert
97
98
Assert . Equal ( string . Empty , xmlComment ) ;
98
- }
99
-
99
+ }
100
+
100
101
[ Fact ]
101
- public void Render_ExtractsPropertySummary_ForMyClassReturnComment ( )
102
+ public void ToPlainText_MyPropertyFromMyClass_ReturnsThisIsTestingPropertyFromMyClass ( )
102
103
{
103
104
// Arrange
104
105
var xdoc = new XDoc ( ) ;
105
- var propertyInfo = typeof ( MyClass ) . GetProperty ( nameof ( MyClass . TestPropertyFromMyClass ) ) ;
106
+ var propertyInfo = typeof ( MyClass ) . GetProperty ( nameof ( MyClass . MyProperty ) ) ;
106
107
107
108
// Act
108
109
var methodocumentation = xdoc . Get ( propertyInfo ) ;
0 commit comments