Skip to content

Commit 1c48cde

Browse files
committed
Updated unit tests with diagnostic location
1 parent 523a357 commit 1c48cde

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

StyleCop.Analyzers/StyleCop.Analyzers.Test/SpacingRules/SA1001UnitTests.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -441,14 +441,14 @@ interface IFormattable {}
441441
interface ISpanFormattable {}
442442
443443
partial struct Money : IFormattable
444-
, ISpanFormattable
444+
{|#0:,|} ISpanFormattable
445445
{
446446
}
447447
";
448448

449449
var expected = new[]
450450
{
451-
DiagnosticResult.CompilerWarning("SA1001").WithSpan(6, 5, 6, 6).WithArguments(" not", "preceded"),
451+
Diagnostic().WithLocation(0).WithArguments(" not", "preceded"),
452452
};
453453

454454
await VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(false);
@@ -464,15 +464,15 @@ interface ISpanFormattable {}
464464
partial struct Money : IFormattable
465465
#if true
466466
467-
, ISpanFormattable
467+
{|#0:,|} ISpanFormattable
468468
#endif
469469
{
470470
}
471471
";
472472

473473
var expected = new[]
474474
{
475-
DiagnosticResult.CompilerWarning("SA1001").WithSpan(8, 5, 8, 6).WithArguments(" not", "preceded"),
475+
Diagnostic().WithLocation(0).WithArguments(" not", "preceded"),
476476
};
477477

478478
await VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(false);
@@ -489,15 +489,15 @@ partial struct Money : IFormattable
489489
#if false
490490
#elif true
491491
492-
, ISpanFormattable
492+
{|#0:,|} ISpanFormattable
493493
#endif
494494
{
495495
}
496496
";
497497

498498
var expected = new[]
499499
{
500-
DiagnosticResult.CompilerWarning("SA1001").WithSpan(9, 5, 9, 6).WithArguments(" not", "preceded"),
500+
Diagnostic().WithLocation(0).WithArguments(" not", "preceded"),
501501
};
502502

503503
await VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(false);
@@ -514,15 +514,15 @@ partial struct Money : IFormattable
514514
#if false
515515
#else
516516
517-
, ISpanFormattable
517+
{|#0:,|} ISpanFormattable
518518
#endif
519519
{
520520
}
521521
";
522522

523523
var expected = new[]
524524
{
525-
DiagnosticResult.CompilerWarning("SA1001").WithSpan(9, 5, 9, 6).WithArguments(" not", "preceded"),
525+
Diagnostic().WithLocation(0).WithArguments(" not", "preceded"),
526526
};
527527

528528
await VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(false);
@@ -540,14 +540,14 @@ partial struct Money : IFormattable
540540
#elif true
541541
#endif
542542
543-
, ISpanFormattable
543+
{|#0:,|} ISpanFormattable
544544
{
545545
}
546546
";
547547

548548
var expected = new[]
549549
{
550-
DiagnosticResult.CompilerWarning("SA1001").WithSpan(10, 5, 10, 6).WithArguments(" not", "preceded"),
550+
Diagnostic().WithLocation(0).WithArguments(" not", "preceded"),
551551
};
552552

553553
await VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(false);

0 commit comments

Comments
 (0)