Skip to content

Commit

Permalink
Convert verbatim strings to regular strings for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
Bartleby2718 committed Jun 28, 2024
1 parent fae8a12 commit 9d005d8
Show file tree
Hide file tree
Showing 26 changed files with 27 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,7 @@ public void CodeFixMaintainsReasonableTriviaWithNewLineClosingParen([Values] boo
[Test]
public void CodeFixMaintainsReasonableTriviaWithAllArgumentsOnSameLine([Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;
var code = TestUtility.WrapInTestMethod($@"
↓ClassicAssert.AreEqual(
2d, 3d, 0.0000001d{optionalNewline});");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ public void CodeFixMaintainsReasonableTriviaWithNewLineClosingParen([Values] boo
[Test]
public void CodeFixMaintainsReasonableTriviaWithAllArgumentsOnSameLine([Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;
var code = TestUtility.WrapInTestMethod($@"
↓ClassicAssert.AreNotEqual(
2d, 3d{optionalNewline});");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,7 @@ public void TestMethod()
[Test]
public void CodeFixMaintainsReasonableTriviaWithAllArgumentsOnSameLine([Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;
var code = TestUtility.WrapMethodInClassNamespaceAndAddUsings($@"
public void TestMethod()
{{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,7 @@ public void TestMethod()
[Test]
public void CodeFixMaintainsReasonableTriviaWithAllArgumentsOnSameLine([Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;
var code = TestUtility.WrapMethodInClassNamespaceAndAddUsings($@"
public void TestMethod()
{{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,7 @@ public void TestMethod()
[Test]
public void CodeFixMaintainsReasonableTriviaWithAllArgumentsOnSameLine([Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;
var code = TestUtility.WrapMethodInClassNamespaceAndAddUsings($@"
public void TestMethod()
{{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,7 @@ public void TestMethod()
[Test]
public void CodeFixMaintainsReasonableTriviaWithAllArgumentsOnSameLine([Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;
var code = TestUtility.WrapMethodInClassNamespaceAndAddUsings($@"
public void TestMethod()
{{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,7 @@ public void TestMethod()
[Test]
public void CodeFixMaintainsReasonableTriviaWithAllArgumentsOnSameLine([Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;
var code = TestUtility.WrapMethodInClassNamespaceAndAddUsings($@"
public void TestMethod()
{{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,7 @@ public void TestMethod()
[Test]
public void CodeFixMaintainsReasonableTriviaWithAllArgumentsOnSameLine([Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;
var code = TestUtility.WrapMethodInClassNamespaceAndAddUsings($@"
public void TestMethod()
{{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,7 @@ public void CodeFixMaintainsReasonableTriviaWithAllArgumentsOnSameLine(
[ValueSource(nameof(diagnosticIds))] string diagnosticId,
[Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;
var assertion = diagnosticIdsToAssertions[diagnosticId];
var expectedDiagnostic = ExpectedDiagnostic.Create(diagnosticId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,7 @@ public void TestMethod()
[Test]
public void CodeFixMaintainsReasonableTriviaWithAllArgumentsOnSameLine([Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;
var code = TestUtility.WrapMethodInClassNamespaceAndAddUsings($@"
public void TestMethod()
{{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,7 @@ public void TestMethod()
[Test]
public void CodeFixMaintainsReasonableTriviaWithAllArgumentsOnSameLine([Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;
var code = TestUtility.WrapMethodInClassNamespaceAndAddUsings($@"
public void TestMethod()
{{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,7 @@ public void TestMethod()
[Test]
public void CodeFixMaintainsReasonableTriviaWithAllArgumentsOnSameLine([Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;
var code = TestUtility.WrapMethodInClassNamespaceAndAddUsings($@"
public void TestMethod()
{{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,7 @@ public void TestMethod()
[Test]
public void CodeFixMaintainsReasonableTriviaWithAllArgumentsOnSameLine([Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;
var code = TestUtility.WrapMethodInClassNamespaceAndAddUsings($@"
public void TestMethod()
{{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@ public void CodeFixMaintainsReasonableTriviaWithAllArgumentsOnSameLine(
[ValueSource(nameof(diagnosticIds))] string diagnosticId,
[Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;
var assertion = diagnosticIdsToAssertions[diagnosticId];
var expectedDiagnostic = ExpectedDiagnostic.Create(diagnosticId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@ public void CodeFixMaintainsReasonableTriviaWithAllArgumentsOnSameLine(
[ValueSource(nameof(diagnosticIds))] string diagnosticId,
[Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;
var assertion = diagnosticIdsToAssertions[diagnosticId];
var expectedDiagnostic = ExpectedDiagnostic.Create(diagnosticId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,7 @@ public void CodeFixMaintainsReasonableTriviaWithAllArgumentsOnSameLine(
[ValueSource(nameof(diagnosticIds))] string diagnosticId,
[Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;
var assertion = diagnosticIdsToAssertions[diagnosticId];
var expectedDiagnostic = ExpectedDiagnostic.Create(diagnosticId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,7 @@ public void CodeFixMaintainsReasonableTriviaWithAllArgumentsOnSameLine(
[ValueSource(nameof(diagnosticIds))] string diagnosticId,
[Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;
var assertion = diagnosticIdsToAssertions[diagnosticId];
var expectedDiagnostic = ExpectedDiagnostic.Create(diagnosticId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,7 @@ public void TestMethod()
[Test]
public void CodeFixMaintainsReasonableTriviaWithAllArgumentsOnSameLine([Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;
var code = TestUtility.WrapMethodInClassNamespaceAndAddUsings($@"
public void TestMethod()
{{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,7 @@ public void TestMethod()
[Test]
public void CodeFixMaintainsReasonableTriviaWithAllArgumentsOnSameLine([Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;
var code = TestUtility.WrapMethodInClassNamespaceAndAddUsings($@"
public void TestMethod()
{{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,7 @@ public void TestMethod()
[Test]
public void CodeFixMaintainsReasonableTriviaWithAllArgumentsOnSameLine([Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;

var code = TestUtility.WrapMethodInClassNamespaceAndAddUsings($@"
public void TestMethod()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,7 @@ public void TestMethod()
[Test]
public void CodeFixMaintainsReasonableTriviaWithAllArgumentsOnSameLine([Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;

var code = TestUtility.WrapMethodInClassNamespaceAndAddUsings($@"
public void TestMethod()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,7 @@ public void CodeFixForTwoCollectionParameterAssertsMaintainsReasonableTriviaWith
[ValueSource(nameof(TwoCollectionParameterAsserts))] string method,
[Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;
var code = TestUtility.WrapInTestMethod(@$"
var collection1 = new[] {{ 1, 2, 3 }};
var collection2 = new[] {{ 2, 4, 6 }};
Expand All @@ -477,8 +476,7 @@ public void CodeFixForCollectionAndItemParameterAssertMaintainsReasonableTriviaW
[ValueSource(nameof(CollectionAndItemParameterAsserts))] string method,
[Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;
var code = TestUtility.WrapInTestMethod(@$"
var collection = new[] {{ typeof(byte), typeof(char) }};
var expected = typeof(byte);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ public void CodeFixMaintainsReasonableTriviaWithAllArgumentsOnSameLine(
[ValueSource(nameof(operatorTokens))] string operatorToken,
[Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;
var constraint = operatorTokensToConstraints[operatorToken];
var code = TestUtility.WrapInTestMethod(@$"
int actual = 5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,7 @@ public void CodeFixMaintainsReasonableTriviaWithNewLineClosingParen([Values] boo
[Test]
public void CodeFixMaintainsReasonableTriviaWithAllArgumentsOnSameLine([Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;
var code = TestUtility.WrapInTestMethod($@"
var actual = ""abc"";
Assert.That(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,7 @@ public void CodeFixMaintainsReasonableTriviaWithNewLineClosingParen()
[Test]
public void CodeFixMaintainsReasonableTriviaWithAllArgumentsOnSameLine([Values] bool newlineBeforeClosingParen)
{
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;
var testCode = TestUtility.WrapInTestMethod($@"
ClassicAssert.IsFalse(
↓new[] {{ 1, 2, 3 }}.Contains(1), ""message""{optionalNewline});",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,7 @@ public void CodeFixMaintainsReasonableTriviaWithAllArgumentsOnSameLine(
{
var analyzerId = NegativeAssertDictionary[method][1];
var suggestedConstraint = NegativeAssertDictionary[method][2];
var optionalNewline = newlineBeforeClosingParen ? @"
" : string.Empty;
var optionalNewline = newlineBeforeClosingParen ? "\r\n " : string.Empty;
var code = TestUtility.WrapInTestMethod($@"
Assert.That(
""abc"".{method}(""ab""), Is.False{optionalNewline});");
Expand Down

0 comments on commit 9d005d8

Please sign in to comment.