You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn4120.UnitTests/Test_UseObservablePropertyOnSemiAutoPropertyCodeFixer.cs
+95Lines changed: 95 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -267,6 +267,75 @@ public partial class SampleViewModel : ObservableObject
// /0/Test0.cs(15,19): info MVVMTK0056: The semi-auto property MyApp.SampleViewModel.LastName can be converted to a partial property using [ObservableProperty], which is recommended (doing so makes the code less verbose and results in more optimized code)
public class TestAttribute(string text) : Attribute;
@@ -474,6 +556,13 @@ public partial class SampleViewModel : ObservableObject
474
556
[ObservableProperty]
475
557
[Test("Yet another attribute")]
476
558
public partial string Prop5 { get; set; }
559
+
560
+
[ObservableProperty]
561
+
[Test("Attribute without trivia")]
562
+
public partial string Prop6 { get; set; }
563
+
564
+
[ObservableProperty]
565
+
public partial string Prop7 { get; set; }
477
566
}
478
567
479
568
public class TestAttribute(string text) : Attribute;
@@ -503,6 +592,12 @@ public class TestAttribute(string text) : Attribute;
503
592
504
593
// /0/Test0.cs(43,19): info MVVMTK0056: The semi-auto property MyApp.SampleViewModel.Prop5 can be converted to a partial property using [ObservableProperty], which is recommended (doing so makes the code less verbose and results in more optimized code)
// /0/Test0.cs(50,19): info MVVMTK0056: The semi-auto property MyApp.SampleViewModel.Prop6 can be converted to a partial property using [ObservableProperty], which is recommended (doing so makes the code less verbose and results in more optimized code)
// /0/Test0.cs(56,19): info MVVMTK0056: The semi-auto property MyApp.SampleViewModel.Prop7 can be converted to a partial property using [ObservableProperty], which is recommended (doing so makes the code less verbose and results in more optimized code)
0 commit comments