|
3 | 3 | // See the LICENSE file in the project root for more information. |
4 | 4 |
|
5 | 5 | using System.Threading.Tasks; |
6 | | -using CommunityToolkit.WinUI; |
7 | | -using Microsoft.CodeAnalysis; |
8 | 6 | using Microsoft.CodeAnalysis.CSharp; |
9 | | -using Microsoft.CodeAnalysis.Testing; |
10 | 7 | using Microsoft.VisualStudio.TestTools.UnitTesting; |
11 | | -using Windows.Foundation; |
12 | | -using Windows.UI.ViewManagement; |
13 | | -using Windows.UI.Xaml; |
14 | 8 | using CSharpCodeFixTest = CommunityToolkit.GeneratedDependencyProperty.Tests.Helpers.CSharpCodeFixTest< |
15 | 9 | CommunityToolkit.GeneratedDependencyProperty.UseGeneratedDependencyPropertyOnManualPropertyAnalyzer, |
16 | 10 | CommunityToolkit.GeneratedDependencyProperty.UseGeneratedDependencyPropertyOnManualPropertyCodeFixer>; |
@@ -110,15 +104,7 @@ public class MyClass { } |
110 | 104 | CSharpCodeFixTest test = new(LanguageVersion.Preview) |
111 | 105 | { |
112 | 106 | TestCode = original, |
113 | | - FixedCode = @fixed, |
114 | | - ReferenceAssemblies = ReferenceAssemblies.Net.Net80, |
115 | | - TestState = { AdditionalReferences = |
116 | | - { |
117 | | - MetadataReference.CreateFromFile(typeof(Point).Assembly.Location), |
118 | | - MetadataReference.CreateFromFile(typeof(ApplicationView).Assembly.Location), |
119 | | - MetadataReference.CreateFromFile(typeof(DependencyProperty).Assembly.Location), |
120 | | - MetadataReference.CreateFromFile(typeof(GeneratedDependencyPropertyAttribute).Assembly.Location) |
121 | | - }} |
| 107 | + FixedCode = @fixed |
122 | 108 | }; |
123 | 109 |
|
124 | 110 | await test.RunAsync(); |
@@ -178,15 +164,7 @@ public enum MyEnum { A, B, C } |
178 | 164 | CSharpCodeFixTest test = new(LanguageVersion.Preview) |
179 | 165 | { |
180 | 166 | TestCode = original, |
181 | | - FixedCode = @fixed, |
182 | | - ReferenceAssemblies = ReferenceAssemblies.Net.Net80, |
183 | | - TestState = { AdditionalReferences = |
184 | | - { |
185 | | - MetadataReference.CreateFromFile(typeof(Point).Assembly.Location), |
186 | | - MetadataReference.CreateFromFile(typeof(ApplicationView).Assembly.Location), |
187 | | - MetadataReference.CreateFromFile(typeof(DependencyProperty).Assembly.Location), |
188 | | - MetadataReference.CreateFromFile(typeof(GeneratedDependencyPropertyAttribute).Assembly.Location) |
189 | | - }} |
| 167 | + FixedCode = @fixed |
190 | 168 | }; |
191 | 169 |
|
192 | 170 | await test.RunAsync(); |
@@ -270,15 +248,7 @@ public partial class MyControl : Control |
270 | 248 | CSharpCodeFixTest test = new(LanguageVersion.Preview) |
271 | 249 | { |
272 | 250 | TestCode = original, |
273 | | - FixedCode = @fixed, |
274 | | - ReferenceAssemblies = ReferenceAssemblies.Net.Net80, |
275 | | - TestState = { AdditionalReferences = |
276 | | - { |
277 | | - MetadataReference.CreateFromFile(typeof(Point).Assembly.Location), |
278 | | - MetadataReference.CreateFromFile(typeof(ApplicationView).Assembly.Location), |
279 | | - MetadataReference.CreateFromFile(typeof(DependencyProperty).Assembly.Location), |
280 | | - MetadataReference.CreateFromFile(typeof(GeneratedDependencyPropertyAttribute).Assembly.Location) |
281 | | - }} |
| 251 | + FixedCode = @fixed |
282 | 252 | }; |
283 | 253 |
|
284 | 254 | await test.RunAsync(); |
@@ -345,15 +315,7 @@ public enum MyEnum { A } |
345 | 315 | CSharpCodeFixTest test = new(LanguageVersion.Preview) |
346 | 316 | { |
347 | 317 | TestCode = original, |
348 | | - FixedCode = @fixed, |
349 | | - ReferenceAssemblies = ReferenceAssemblies.Net.Net80, |
350 | | - TestState = { AdditionalReferences = |
351 | | - { |
352 | | - MetadataReference.CreateFromFile(typeof(Point).Assembly.Location), |
353 | | - MetadataReference.CreateFromFile(typeof(ApplicationView).Assembly.Location), |
354 | | - MetadataReference.CreateFromFile(typeof(DependencyProperty).Assembly.Location), |
355 | | - MetadataReference.CreateFromFile(typeof(GeneratedDependencyPropertyAttribute).Assembly.Location) |
356 | | - }} |
| 318 | + FixedCode = @fixed |
357 | 319 | }; |
358 | 320 |
|
359 | 321 | await test.RunAsync(); |
@@ -406,15 +368,7 @@ public partial class MyControl : Control |
406 | 368 | CSharpCodeFixTest test = new(LanguageVersion.Preview) |
407 | 369 | { |
408 | 370 | TestCode = original, |
409 | | - FixedCode = @fixed, |
410 | | - ReferenceAssemblies = ReferenceAssemblies.Net.Net80, |
411 | | - TestState = { AdditionalReferences = |
412 | | - { |
413 | | - MetadataReference.CreateFromFile(typeof(Point).Assembly.Location), |
414 | | - MetadataReference.CreateFromFile(typeof(ApplicationView).Assembly.Location), |
415 | | - MetadataReference.CreateFromFile(typeof(DependencyProperty).Assembly.Location), |
416 | | - MetadataReference.CreateFromFile(typeof(GeneratedDependencyPropertyAttribute).Assembly.Location) |
417 | | - }} |
| 371 | + FixedCode = @fixed |
418 | 372 | }; |
419 | 373 |
|
420 | 374 | await test.RunAsync(); |
|
0 commit comments