This commit is contained in:
Matt Chaulklin 2024-08-21 12:51:59 -04:00
Родитель dda9795a1d
Коммит e7070a95ce
4 изменённых файлов: 19 добавлений и 7 удалений

Просмотреть файл

@ -692,7 +692,11 @@ namespace Microsoft.CodeAnalysis.Testing
try
{
if (expectedNumberOfIterations >= 0)
if (expectedNumberOfIterations == 0 && numberOfIterations <= 0)
{
verifier.Equal(expectedNumberOfIterations, expectedNumberOfIterations - numberOfIterations, "No code fixes were expected, but a fix was offered that made no changes to the code.");
}
else if (expectedNumberOfIterations >= 0)
{
verifier.Equal(expectedNumberOfIterations, expectedNumberOfIterations - numberOfIterations, $"Expected '{expectedNumberOfIterations}' iterations but found '{expectedNumberOfIterations - numberOfIterations}' iterations.");
}
@ -862,7 +866,11 @@ namespace Microsoft.CodeAnalysis.Testing
try
{
if (expectedNumberOfIterations >= 0)
if (expectedNumberOfIterations == 0 && numberOfIterations <= 0)
{
verifier.Equal(expectedNumberOfIterations, expectedNumberOfIterations - numberOfIterations, "No code fixes were expected, but a fix was offered that made no changes to the code.");
}
else if (expectedNumberOfIterations >= 0)
{
verifier.Equal(expectedNumberOfIterations, expectedNumberOfIterations - numberOfIterations, $"Expected '{expectedNumberOfIterations}' iterations but found '{expectedNumberOfIterations - numberOfIterations}' iterations.");
}

Просмотреть файл

@ -302,7 +302,11 @@ namespace Microsoft.CodeAnalysis.Testing
try
{
if (expectedNumberOfIterations >= 0)
if (expectedNumberOfIterations == 0 && numberOfIterations <= 0)
{
verifier.Equal(expectedNumberOfIterations, expectedNumberOfIterations - numberOfIterations, "No code fixes were expected, but a fix was offered that made no changes to the code.");
}
else if (expectedNumberOfIterations >= 0)
{
verifier.Equal(expectedNumberOfIterations, expectedNumberOfIterations - numberOfIterations, $"Expected '{expectedNumberOfIterations}' iterations but found '{expectedNumberOfIterations - numberOfIterations}' iterations.");
}

Просмотреть файл

@ -78,7 +78,7 @@ namespace Microsoft.CodeAnalysis.Testing
Assert.Equal(
"""
Context: Iterative code fix application
Expected '0' iterations but found '1' iterations.
No code fixes were expected, but a fix was offered that made no changes to the code.
""".ReplaceLineEndings(),
exception.Message);
@ -91,7 +91,7 @@ namespace Microsoft.CodeAnalysis.Testing
Assert.Equal(
"""
Context: Iterative code fix application
Expected '0' iterations but found '1' iterations.
No code fixes were expected, but a fix was offered that made no changes to the code.
""".ReplaceLineEndings(),
exception.Message);
}

Просмотреть файл

@ -82,7 +82,7 @@ namespace Microsoft.CodeAnalysis.Testing
Assert.Equal(
"""
Context: Iterative code fix application
Expected '0' iterations but found '1' iterations.
No code fixes were expected, but a fix was offered that made no changes to the code.
""".ReplaceLineEndings(),
exception.Message);
@ -95,7 +95,7 @@ namespace Microsoft.CodeAnalysis.Testing
Assert.Equal(
"""
Context: Iterative code fix application
Expected '0' iterations but found '1' iterations.
No code fixes were expected, but a fix was offered that made no changes to the code.
""".ReplaceLineEndings(),
exception.Message);
}