|
3 | 3 |
|
4 | 4 | namespace StyleCop.Analyzers.Test.ReadabilityRules |
5 | 5 | { |
| 6 | + using System; |
6 | 7 | using System.Threading; |
7 | 8 | using System.Threading.Tasks; |
8 | 9 | using Microsoft.CodeAnalysis.Testing; |
@@ -241,6 +242,9 @@ public T TestMethod2<T>() |
241 | 242 | /// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns> |
242 | 243 | [Theory] |
243 | 244 | [InlineData("System.Threading", nameof(CancellationToken), nameof(CancellationToken.None))] |
| 245 | + [InlineData("System", nameof(IntPtr), nameof(IntPtr.Zero))] |
| 246 | + [InlineData("System", nameof(UIntPtr), nameof(UIntPtr.Zero))] |
| 247 | + [InlineData("System", nameof(Guid), nameof(Guid.Empty))] |
244 | 248 | public async Task VerifySpecialTypeFixUsesSpecialSyntaxAsync(string typeNamespace, string typeName, string fieldName) |
245 | 249 | { |
246 | 250 | var testCode = $@" |
@@ -279,6 +283,9 @@ public void TestMethod() |
279 | 283 | /// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns> |
280 | 284 | [Theory] |
281 | 285 | [InlineData("System.Threading", nameof(CancellationToken), nameof(CancellationToken.None))] |
| 286 | + [InlineData("System", nameof(IntPtr), nameof(IntPtr.Zero))] |
| 287 | + [InlineData("System", nameof(UIntPtr), nameof(UIntPtr.Zero))] |
| 288 | + [InlineData("System", nameof(Guid), nameof(Guid.Empty))] |
282 | 289 | public async Task VerifySpecialTypeTriviaPreservationAsync(string typeNamespace, string typeName, string fieldName) |
283 | 290 | { |
284 | 291 | var testCode = $@" |
@@ -318,6 +325,9 @@ public void TestMethod() |
318 | 325 | /// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns> |
319 | 326 | [Theory] |
320 | 327 | [InlineData("System.Threading", nameof(CancellationToken), nameof(CancellationToken.None))] |
| 328 | + [InlineData("System", nameof(IntPtr), nameof(IntPtr.Zero))] |
| 329 | + [InlineData("System", nameof(UIntPtr), nameof(UIntPtr.Zero))] |
| 330 | + [InlineData("System", nameof(Guid), nameof(Guid.Empty))] |
321 | 331 | public async Task VerifyQualifiedSpecialTypeFixUsesFieldSyntaxAsync(string typeNamespace, string typeName, string fieldName) |
322 | 332 | { |
323 | 333 | var testCode = $@" |
@@ -351,6 +361,9 @@ public void TestMethod() |
351 | 361 | /// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns> |
352 | 362 | [Theory] |
353 | 363 | [InlineData(nameof(CancellationToken))] |
| 364 | + [InlineData(nameof(IntPtr))] |
| 365 | + [InlineData(nameof(UIntPtr))] |
| 366 | + [InlineData(nameof(Guid))] |
354 | 367 | public async Task VerifyCustomSpecialTypeStructIsNotReplacedAsync(string typeName) |
355 | 368 | { |
356 | 369 | var testCode = $@"public class TestClass |
@@ -394,6 +407,9 @@ private struct {typeName} |
394 | 407 | /// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns> |
395 | 408 | [Theory] |
396 | 409 | [InlineData("System.Threading", nameof(CancellationToken), nameof(CancellationToken.None))] |
| 410 | + [InlineData("System", nameof(IntPtr), nameof(IntPtr.Zero))] |
| 411 | + [InlineData("System", nameof(UIntPtr), nameof(UIntPtr.Zero))] |
| 412 | + [InlineData("System", nameof(Guid), nameof(Guid.Empty))] |
397 | 413 | public async Task VerifyAliasedSpecialTypeUsesFieldSyntaxAsync(string typeNamespace, string typeName, string fieldName) |
398 | 414 | { |
399 | 415 | var testCode = $@" |
@@ -508,6 +524,9 @@ private enum MyEnum {{ {declarationBody} }} |
508 | 524 | /// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns> |
509 | 525 | [Theory] |
510 | 526 | [InlineData("System.Threading", nameof(CancellationToken))] |
| 527 | + [InlineData("System", nameof(IntPtr))] |
| 528 | + [InlineData("System", nameof(UIntPtr))] |
| 529 | + [InlineData("System", nameof(Guid))] |
511 | 530 | [WorkItem(2740, "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/2740")] |
512 | 531 | public async Task VerifySpecialTypeDefaultParameterAsync(string typeNamespace, string typeName) |
513 | 532 | { |
|
0 commit comments