You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: StyleCop.Analyzers/StyleCop.Analyzers.Test/DocumentationRules/NoXmlFileHeaderUnitTests.cs
+87-2Lines changed: 87 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -25,14 +25,16 @@ public class NoXmlFileHeaderUnitTests : CodeFixVerifier
25
25
""copyrightText"": ""Copyright (c) {companyName}. All rights reserved.\nLicensed under the {licenseName} license. See {licenseFile} file in the project root for full license information."",
26
26
""variables"": {
27
27
""licenseName"": ""???"",
28
-
""licenseFile"": ""LICENSE"",
28
+
""licenseFile"": ""LICENSE""
29
29
},
30
30
""xmlHeader"": false
31
31
}
32
32
}
33
33
}
34
34
";
35
35
36
+
privatestringcurrentTestSettings=TestSettings;
37
+
36
38
/// <summary>
37
39
/// Verifies that the analyzer will report <see cref="FileHeaderAnalyzers.SA1633DescriptorMissing"/> for
38
40
/// projects not using XML headers when the file is completely missing a header.
@@ -48,6 +50,89 @@ public virtual async Task TestNoFileHeaderAsync()
48
50
varfixedCode=@"// Copyright (c) FooCorp. All rights reserved.
49
51
// Licensed under the ??? license. See LICENSE file in the project root for full license information.
""copyrightText"": ""{fileName} Copyright (c) {companyName}. All rights reserved.\nLicensed under the {licenseName} license. See {licenseFile} file in the project root for full license information."",
77
+
""variables"": {
78
+
""licenseName"": ""???"",
79
+
""licenseFile"": ""LICENSE""
80
+
},
81
+
""xmlHeader"": false
82
+
}
83
+
}
84
+
}
85
+
";
86
+
87
+
vartestCode=@"namespace Foo
88
+
{
89
+
}
90
+
";
91
+
varfixedCode=@"// Test0.cs Copyright (c) FooCorp. All rights reserved.
92
+
// Licensed under the ??? license. See LICENSE file in the project root for full license information.
""copyrightText"": ""{fileName} Copyright (c) {companyName}. All rights reserved.\nLicensed under the {licenseName} license. See {licenseFile} file in the project root for full license information."",
118
+
""variables"": {
119
+
""licenseName"": ""???"",
120
+
""licenseFile"": ""LICENSE"",
121
+
""fileName"": ""Not a file""
122
+
},
123
+
""xmlHeader"": false
124
+
}
125
+
}
126
+
}
127
+
";
128
+
129
+
vartestCode=@"namespace Foo
130
+
{
131
+
}
132
+
";
133
+
varfixedCode=@"// Not a file Copyright (c) FooCorp. All rights reserved.
134
+
// Licensed under the ??? license. See LICENSE file in the project root for full license information.
0 commit comments