Skip to content

Commit 10d8c1e

Browse files
authored
Merge pull request #1 from d1820/lang-parser-updates
Lang parser updates
2 parents a82ac98 + 637f89e commit 10d8c1e

58 files changed

Lines changed: 2945 additions & 866 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CodeDocumentor.Test/ClassUnitTests.cs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
1-
using CodeDocumentor.Vsix2022;
1+
using System.Diagnostics.CodeAnalysis;
2+
using CodeDocumentor.Vsix2022;
23
using Microsoft.CodeAnalysis;
34
using Microsoft.CodeAnalysis.CodeFixes;
45
using Microsoft.CodeAnalysis.Diagnostics;
56
using Microsoft.VisualStudio.TestTools.UnitTesting;
6-
using TestHelper;
77

88
namespace CodeDocumentor.Test
99
{
10-
/// <summary>
11-
/// The class unit test.
12-
/// </summary>
13-
[TestClass]
14-
public class ClassUnitTest : CodeFixVerifier
15-
{
16-
[TestInitialize]
17-
public void Init()
18-
{
19-
}
20-
/// <summary>
10+
[SuppressMessage("XMLDocumentation","")]
11+
public partial class ClassUnitTest
12+
{
13+
/// <summary>
2114
/// The inherit doc test code.
2215
/// </summary>
2316
private const string InheritDocTestCode = @"
@@ -33,10 +26,10 @@ class ClassTester
3326
}
3427
}";
3528

36-
/// <summary>
37-
/// The test code.
38-
/// </summary>
39-
private const string TestCode = @"
29+
/// <summary>
30+
/// The test code.
31+
/// </summary>
32+
private const string TestCode = @"
4033
using System;
4134
using System.Collections.Generic;
4235
using System.Text;
@@ -48,10 +41,10 @@ class ClassTester
4841
}
4942
}";
5043

51-
/// <summary>
52-
/// The test fix code.
53-
/// </summary>
54-
private const string TestFixCode = @"
44+
/// <summary>
45+
/// The test fix code.
46+
/// </summary>
47+
private const string TestFixCode = @"
5548
using System;
5649
using System.Collections.Generic;
5750
using System.Text;
@@ -65,7 +58,14 @@ class ClassTester
6558
{
6659
}
6760
}";
68-
61+
}
62+
/// <summary>
63+
/// The class unit test.
64+
/// </summary>
65+
[TestClass]
66+
public partial class ClassUnitTest : CodeFixVerifier
67+
{
68+
6969
/// <summary>
7070
/// Nos diagnostics show.
7171
/// </summary>

CodeDocumentor.Test/CodeDocumentor.Test.csproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,25 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8+
<PackageReference Include="FluentAssertions" Version="6.3.0" />
89
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3">
910
<PrivateAssets>all</PrivateAssets>
1011
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1112
</PackageReference>
1213
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.0.1" />
1314
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
15+
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.0.31902.203" />
16+
<PackageReference Include="Microsoft.VisualStudio.Shell.15.0" Version="17.0.31902.203" />
17+
<PackageReference Include="Moq" Version="4.16.1" />
1418
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
1519
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
1620
<PackageReference Include="Pluralize.NET" Version="1.0.2" />
21+
<PackageReference Include="xunit" Version="2.4.1" />
22+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
23+
<PrivateAssets>all</PrivateAssets>
24+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
25+
</PackageReference>
26+
<PackageReference Include="coverlet.collector" Version="3.1.0" />
1727
</ItemGroup>
1828

1929
<ItemGroup>

CodeDocumentor.Test/ConstructorUnitTests.cs

Lines changed: 48 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1+
using System.Diagnostics.CodeAnalysis;
2+
using CodeDocumentor.Vsix2022;
13
using Microsoft.CodeAnalysis;
24
using Microsoft.CodeAnalysis.CodeFixes;
35
using Microsoft.CodeAnalysis.Diagnostics;
46
using Microsoft.VisualStudio.TestTools.UnitTesting;
5-
using TestHelper;
67

78
namespace CodeDocumentor.Test
89
{
9-
/// <summary>
10-
/// The constructor unit test.
11-
/// </summary>
12-
[TestClass]
13-
public class ConstrcutorUnitTest : CodeFixVerifier
14-
{
15-
/// <summary>
16-
/// The inherit doc test code.
17-
/// </summary>
18-
private const string InheritDocTestCode = @"
10+
[SuppressMessage("XMLDocumentation", "")]
11+
public partial class ConstrcutorUnitTest {
12+
13+
/// <summary>
14+
/// The inherit doc test code.
15+
/// </summary>
16+
private const string InheritDocTestCode = @"
1917
using System;
2018
using System.Collections.Generic;
2119
using System.Text;
@@ -31,10 +29,10 @@ public ConstructorTester()
3129
}
3230
}";
3331

34-
/// <summary>
35-
/// The public constructor test code.
36-
/// </summary>
37-
private const string PublicConstructorTestCode = @"
32+
/// <summary>
33+
/// The public constructor test code.
34+
/// </summary>
35+
private const string PublicConstructorTestCode = @"
3836
using System;
3937
using System.Collections.Generic;
4038
using System.Text;
@@ -49,10 +47,10 @@ public ConstructorTester()
4947
}
5048
}";
5149

52-
/// <summary>
53-
/// The public contructor test fix code.
54-
/// </summary>
55-
private const string PublicContructorTestFixCode = @"
50+
/// <summary>
51+
/// The public constructor test fix code.
52+
/// </summary>
53+
private const string PublicContructorTestFixCode = @"
5654
using System;
5755
using System.Collections.Generic;
5856
using System.Text;
@@ -70,10 +68,10 @@ public ConstructorTester()
7068
}
7169
}";
7270

73-
/// <summary>
74-
/// The private constructor test code.
75-
/// </summary>
76-
private const string PrivateConstructorTestCode = @"
71+
/// <summary>
72+
/// The private constructor test code.
73+
/// </summary>
74+
private const string PrivateConstructorTestCode = @"
7775
using System;
7876
using System.Collections.Generic;
7977
using System.Text;
@@ -88,10 +86,10 @@ private ConstructorTester()
8886
}
8987
}";
9088

91-
/// <summary>
92-
/// The private contructor test fix code.
93-
/// </summary>
94-
private const string PrivateContructorTestFixCode = @"
89+
/// <summary>
90+
/// The private constructor test fix code.
91+
/// </summary>
92+
private const string PrivateContructorTestFixCode = @"
9593
using System;
9694
using System.Collections.Generic;
9795
using System.Text;
@@ -109,10 +107,10 @@ private ConstructorTester()
109107
}
110108
}";
111109

112-
/// <summary>
113-
/// The public constructor test code.
114-
/// </summary>
115-
private const string PublicConstructorWithBooleanParameterTestCode = @"
110+
/// <summary>
111+
/// The public constructor test code.
112+
/// </summary>
113+
private const string PublicConstructorWithBooleanParameterTestCode = @"
116114
using System;
117115
using System.Collections.Generic;
118116
using System.Text;
@@ -127,10 +125,10 @@ public ConstructorTester(bool isRed, bool? isAssociatedWithAllProduct)
127125
}
128126
}";
129127

130-
/// <summary>
131-
/// The public contructor test fix code.
132-
/// </summary>
133-
private const string PublicContructorWithBooleanParameterTestFixCode = @"
128+
/// <summary>
129+
/// The public contructor test fix code.
130+
/// </summary>
131+
private const string PublicContructorWithBooleanParameterTestFixCode = @"
134132
using System;
135133
using System.Collections.Generic;
136134
using System.Text;
@@ -149,6 +147,21 @@ public ConstructorTester(bool isRed, bool? isAssociatedWithAllProduct)
149147
}
150148
}
151149
}";
150+
}
151+
/// <summary>
152+
/// The constructor unit test.
153+
/// </summary>
154+
[TestClass]
155+
[SuppressMessage("XMLDocumentation", "")]
156+
public partial class ConstrcutorUnitTest : CodeFixVerifier
157+
{
158+
159+
[TestInitialize]
160+
public void Init()
161+
{
162+
CodeDocumentorPackage.Options = TestFixture.BuildOptionsPageGrid();
163+
}
164+
152165
/// <summary>
153166
/// Nos diagnostics show.
154167
/// </summary>

CodeDocumentor.Test/EnumUnitTests.cs

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1+
using System.Diagnostics.CodeAnalysis;
12
using Microsoft.CodeAnalysis;
23
using Microsoft.CodeAnalysis.CodeFixes;
34
using Microsoft.CodeAnalysis.Diagnostics;
45
using Microsoft.VisualStudio.TestTools.UnitTesting;
5-
using TestHelper;
66

77
namespace CodeDocumentor.Test
88
{
9-
/// <summary>
10-
/// The enum unit test.
11-
/// </summary>
12-
[TestClass]
13-
public class EnumUnitTest : CodeFixVerifier
14-
{
15-
/// <summary>
16-
/// The test code.
17-
/// </summary>
18-
private const string TestCode = @"
9+
[SuppressMessage("XMLDocumentation", "")]
10+
public partial class EnumUnitTest
11+
{
12+
/// <summary>
13+
/// The test code.
14+
/// </summary>
15+
private const string TestCode = @"
1916
using System;
2017
using System.Collections.Generic;
2118
using System.Text;
@@ -27,10 +24,10 @@ enum EnumTester
2724
}
2825
}";
2926

30-
/// <summary>
31-
/// The test fix code.
32-
/// </summary>
33-
private const string TestFixCode = @"
27+
/// <summary>
28+
/// The test fix code.
29+
/// </summary>
30+
private const string TestFixCode = @"
3431
using System;
3532
using System.Collections.Generic;
3633
using System.Text;
@@ -45,6 +42,14 @@ enum EnumTester
4542
}
4643
}";
4744

45+
}
46+
/// <summary>
47+
/// The enum unit test.
48+
/// </summary>
49+
[TestClass]
50+
public partial class EnumUnitTest : CodeFixVerifier
51+
{
52+
4853
/// <summary>
4954
/// Nos diagnostics show.
5055
/// </summary>

CodeDocumentor.Test/FieldUnitTests.cs

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1+
using System.Diagnostics.CodeAnalysis;
12
using Microsoft.CodeAnalysis;
23
using Microsoft.CodeAnalysis.CodeFixes;
34
using Microsoft.CodeAnalysis.Diagnostics;
45
using Microsoft.VisualStudio.TestTools.UnitTesting;
5-
using TestHelper;
66

77
namespace CodeDocumentor.Test
88
{
9-
/// <summary>
10-
/// The field unit test.
11-
/// </summary>
12-
[TestClass]
13-
public class FieldUnitTest : CodeFixVerifier
14-
{
15-
/// <summary>
16-
/// The inherit doc test code.
17-
/// </summary>
18-
private const string InheritDocTestCode = @"
9+
[SuppressMessage("XMLDocumentation", "")]
10+
public partial class FieldUnitTest
11+
{
12+
/// <summary>
13+
/// The inherit doc test code.
14+
/// </summary>
15+
private const string InheritDocTestCode = @"
1916
using System;
2017
using System.Collections.Generic;
2118
using System.Text;
@@ -33,10 +30,10 @@ public FieldTester()
3330
}
3431
}";
3532

36-
/// <summary>
37-
/// The const field test code.
38-
/// </summary>
39-
private const string ConstFieldTestCode = @"
33+
/// <summary>
34+
/// The const field test code.
35+
/// </summary>
36+
private const string ConstFieldTestCode = @"
4037
using System;
4138
using System.Collections.Generic;
4239
using System.Text;
@@ -53,10 +50,10 @@ public FieldTester()
5350
}
5451
}";
5552

56-
/// <summary>
57-
/// The const field test fix code.
58-
/// </summary>
59-
private const string ConstFieldTestFixCode = @"
53+
/// <summary>
54+
/// The const field test fix code.
55+
/// </summary>
56+
private const string ConstFieldTestFixCode = @"
6057
using System;
6158
using System.Collections.Generic;
6259
using System.Text;
@@ -76,6 +73,14 @@ public FieldTester()
7673
}
7774
}";
7875

76+
}
77+
/// <summary>
78+
/// The field unit test.
79+
/// </summary>
80+
[TestClass]
81+
public partial class FieldUnitTest : CodeFixVerifier
82+
{
83+
7984
/// <summary>
8085
/// Nos diagnostics show.
8186
/// </summary>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// This file is used by Code Analysis to maintain SuppressMessage
2+
// attributes that are applied to this project.
3+
// Project-level suppressions either have no target or are given
4+
// a specific target and scoped to a namespace, type, member, etc.
5+
6+
using System.Diagnostics.CodeAnalysis;
7+
8+
[assembly: SuppressMessage("CodeDocumentor", "CD1605:The method must have a documentation header.", Justification = "<Pending>", Scope = "member", Target = "~M:CodeDocumentor.Test.CodeFixVerifier.Init")]
9+
[assembly: SuppressMessage("CodeDocumentor", "CD1603:The field must have a documentation header.", Justification = "<Pending>", Scope = "member", Target = "~F:CodeDocumentor.Test.MethodUnitTest.MethodWithNoException")]
10+
[assembly: SuppressMessage("CodeDocumentor", "CD1603:The field must have a documentation header.", Justification = "<Pending>", Scope = "member", Target = "~F:CodeDocumentor.Test.MethodUnitTest.MethodWithException")]
11+
[assembly: SuppressMessage("CodeDocumentor", "CD1605:The method must have a documentation header.", Justification = "<Pending>", Scope = "member", Target = "~M:CodeDocumentor.Test.MethodUnitTest.GetExceptions_ReturnsMatches~System.Threading.Tasks.Task")]
12+
[assembly: SuppressMessage("CodeDocumentor", "CD1600:The class must have a documentation header.", Justification = "<Pending>", Scope = "type", Target = "~T:CodeDocumentor.Test.Helper.TranslatorTests")]

0 commit comments

Comments
 (0)