Skip to content

Commit

Permalink
Merge pull request #54319 from dotnet/merges/main-to-main-vs-deps
Browse files Browse the repository at this point in the history
Merge main to main-vs-deps
  • Loading branch information
msftbot[bot] committed Jun 23, 2021
2 parents ddb105d + 36930f1 commit 4c7bc54
Show file tree
Hide file tree
Showing 11 changed files with 366 additions and 438 deletions.
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<!-- Versions used by several individual references below -->
<RoslynDiagnosticsNugetPackageVersion>3.3.3-beta1.21105.3</RoslynDiagnosticsNugetPackageVersion>
<MicrosoftCodeAnalysisNetAnalyzersVersion>6.0.0-preview1.21054.10</MicrosoftCodeAnalysisNetAnalyzersVersion>
<MicrosoftCodeAnalysisTestingVersion>1.0.1-beta1.20623.3</MicrosoftCodeAnalysisTestingVersion>
<MicrosoftCodeAnalysisTestingVersion>1.1.0-beta1.21322.2</MicrosoftCodeAnalysisTestingVersion>
<CodeStyleAnalyzerVersion>3.10.0</CodeStyleAnalyzerVersion>
<VisualStudioEditorPackagesVersion>16.10.230</VisualStudioEditorPackagesVersion>
<VisualStudioEditorNewPackagesVersion>17.0.65-g6c25c21ba5</VisualStudioEditorNewPackagesVersion>
Expand Down
11 changes: 5 additions & 6 deletions src/CodeStyle/CSharp/Tests/FormattingAnalyzerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -270,16 +270,15 @@ void MyMethod()

await new CSharpCodeFixTest<CSharpFormattingAnalyzer, CSharpFormattingCodeFixProvider, XUnitVerifier>
{
TestState = { Sources = { (Path.GetFullPath("Test0.cs"), testCode) } },
FixedState = { Sources = { (Path.GetFullPath("Test0.cs"), fixedCode) } },
SolutionTransforms =
TestState =
{
(solution, projectId) =>
Sources = { testCode },
AnalyzerConfigFiles =
{
var documentId = DocumentId.CreateNewId(projectId, ".editorconfig");
return solution.AddAnalyzerConfigDocument(documentId, ".editorconfig", SourceText.From(editorConfig, Encoding.UTF8), filePath: Path.GetFullPath(".editorconfig"));
("/.editorconfig", editorConfig),
},
},
FixedState = { Sources = { fixedCode } },
}.RunAsync();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<Compile Include="..\..\..\EditorFeatures\DiagnosticsTestUtilities\CodeActions\CSharpCodeRefactoringVerifier`1+Test.cs" Link="CSharpCodeRefactoringVerifier`1+Test.cs" />
<Compile Include="..\..\..\EditorFeatures\DiagnosticsTestUtilities\CodeActions\CSharpCodeRefactoringVerifier`1.cs" Link="CSharpCodeRefactoringVerifier`1.cs" />
<Compile Include="..\..\..\EditorFeatures\DiagnosticsTestUtilities\CodeActions\CSharpVerifierHelper.cs" Link="CSharpVerifierHelper.cs" />
<Compile Include="..\..\..\EditorFeatures\DiagnosticsTestUtilities\CodeActions\SharedVerifierState.cs" Link="SharedVerifierState.cs" />
<Compile Include="..\..\..\EditorFeatures\DiagnosticsTestUtilities\CodeActions\VisualBasicCodeFixVerifier`2+Test.cs" Link="VisualBasicCodeFixVerifier`2+Test.cs" />
<Compile Include="..\..\..\EditorFeatures\DiagnosticsTestUtilities\CodeActions\VisualBasicCodeFixVerifier`2.cs" Link="VisualBasicCodeFixVerifier`2.cs" />
<Compile Include="..\..\..\EditorFeatures\DiagnosticsTestUtilities\CodeActions\VisualBasicCodeRefactoringVerifier`1+Test.cs" Link="VisualBasicCodeRefactoringVerifier`1+Test.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ private static async Task TestAsync(
if (index != 0)
Assert.NotNull(equivalenceKey);

var test = new VerifyCS.Test
options ??= new OptionsCollection(LanguageNames.CSharp);

await new VerifyCS.Test
{
TestCode = text,
FixedCode = expected,
Expand All @@ -57,11 +59,8 @@ private static async Task TestAsync(
CodeActionIndex = index,
CodeActionEquivalenceKey = equivalenceKey,
ExactActionSetOffered = actions,
};

if (options != null)
test.Options.AddRange(options);
await test.RunAsync();
Options = { options },
}.RunAsync();
}

#region update containing member tests
Expand Down Expand Up @@ -2278,7 +2277,8 @@ public static implicit operator NewStruct((int a, int a) value)
return new NewStruct(value.a, value.a);
}
}";
var test = new VerifyCS.Test

await new VerifyCS.Test
{
TestCode = text,
FixedCode = expected,
Expand Down Expand Up @@ -2349,11 +2349,9 @@ public static implicit operator NewStruct((int a, int a) value)
// /0/Test0.cs(49,45): error CS0229: Ambiguity between '(int a, int a).a' and '(int a, int a).a'
DiagnosticResult.CompilerError("CS0229").WithSpan(49, 45, 49, 46).WithArguments("(int a, int a).a", "(int a, int a).a"),
}
}
};

test.Options.AddRange(PreferImplicitTypeWithInfo());
await test.RunAsync();
},
Options = { PreferImplicitTypeWithInfo() },
}.RunAsync();
}

[Theory, CombinatorialData, Trait(Traits.Feature, Traits.Features.CodeActionsConvertTupleToStruct)]
Expand Down Expand Up @@ -3352,7 +3350,7 @@ void Goo()
}
}";

var test = new VerifyCS.Test
await new VerifyCS.Test
{
TestState =
{
Expand All @@ -3373,10 +3371,8 @@ void Goo()
CodeActionIndex = 1,
CodeActionEquivalenceKey = Scope.ContainingType.ToString(),
TestHost = host,
};

test.Options.AddRange(PreferImplicitTypeWithInfo());
await test.RunAsync();
Options = { PreferImplicitTypeWithInfo() },
}.RunAsync();
}

#endregion update containing project tests
Expand Down Expand Up @@ -3511,7 +3507,7 @@ void Goo()
}
}";

var test = new VerifyCS.Test
await new VerifyCS.Test
{
CodeActionIndex = 2,
CodeActionEquivalenceKey = Scope.ContainingProject.ToString(),
Expand All @@ -3524,10 +3520,8 @@ void Goo()
{
Sources = { expected1, expected2 },
},
};

test.Options.AddRange(PreferImplicitTypeWithInfo());
await test.RunAsync();
Options = { PreferImplicitTypeWithInfo() },
}.RunAsync();
}

#endregion
Expand Down Expand Up @@ -3638,7 +3632,7 @@ void Goo()
}
}";

var test = new VerifyCS.Test
await new VerifyCS.Test
{
CodeActionIndex = 3,
CodeActionEquivalenceKey = Scope.DependentProjects.ToString(),
Expand Down Expand Up @@ -3667,10 +3661,8 @@ void Goo()
}
},
},
};

test.Options.AddRange(PreferImplicitTypeWithInfo());
await test.RunAsync();
Options = { PreferImplicitTypeWithInfo() },
}.RunAsync();
}

[Theory, CombinatorialData, Trait(Traits.Feature, Traits.Features.CodeActionsConvertTupleToStruct)]
Expand Down Expand Up @@ -3777,7 +3769,7 @@ void Goo()
}
}";

var test = new VerifyCS.Test
await new VerifyCS.Test
{
CodeActionIndex = 3,
CodeActionEquivalenceKey = Scope.DependentProjects.ToString(),
Expand All @@ -3798,10 +3790,8 @@ void Goo()
["DependencyProject"] = { Sources = { expected2 } }
},
},
};

test.Options.AddRange(PreferImplicitTypeWithInfo());
await test.RunAsync();
Options = { PreferImplicitTypeWithInfo() },
}.RunAsync();
}

#endregion
Expand Down
Loading

0 comments on commit 4c7bc54

Please sign in to comment.