Skip to content

Commit 64f13e0

Browse files
committed
Annotate test code.
1 parent de99de3 commit 64f13e0

3 files changed

Lines changed: 66 additions & 65 deletions

File tree

PropertyChangedAnalyzers.Test/INPC003NotifyForDependentProperty/CodeFix.cs

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -700,8 +700,8 @@ namespace N
700700
701701
public class C : INotifyPropertyChanged
702702
{
703-
private string firstName;
704-
private string lastName;
703+
private string? firstName;
704+
private string? lastName;
705705
706706
public event PropertyChangedEventHandler? PropertyChanged;
707707
@@ -715,7 +715,7 @@ public string FullName
715715
}
716716
}
717717
718-
public string FirstName
718+
public string? FirstName
719719
{
720720
get
721721
{
@@ -735,7 +735,7 @@ public string FirstName
735735
}
736736
}
737737
738-
public string LastName
738+
public string? LastName
739739
{
740740
get
741741
{
@@ -771,8 +771,8 @@ namespace N
771771
772772
public class C : INotifyPropertyChanged
773773
{
774-
private string firstName;
775-
private string lastName;
774+
private string? firstName;
775+
private string? lastName;
776776
777777
public event PropertyChangedEventHandler? PropertyChanged;
778778
@@ -786,7 +786,7 @@ public string FullName
786786
}
787787
}
788788
789-
public string FirstName
789+
public string? FirstName
790790
{
791791
get
792792
{
@@ -807,7 +807,7 @@ public string FirstName
807807
}
808808
}
809809
810-
public string LastName
810+
public string? LastName
811811
{
812812
get
813813
{
@@ -2236,12 +2236,12 @@ namespace N
22362236
22372237
public class C : INotifyPropertyChanged
22382238
{
2239-
private string p2;
2240-
private string p3;
2239+
private string? p2;
2240+
private string? p3;
22412241
22422242
public event PropertyChangedEventHandler? PropertyChanged;
22432243
2244-
public IEnumerable<string> P1
2244+
public IEnumerable<string?> P1
22452245
{
22462246
get
22472247
{
@@ -2250,7 +2250,7 @@ public IEnumerable<string> P1
22502250
}
22512251
}
22522252
2253-
public string P2
2253+
public string? P2
22542254
{
22552255
get
22562256
{
@@ -2269,7 +2269,7 @@ public string P2
22692269
}
22702270
}
22712271
2272-
public string P3
2272+
public string? P3
22732273
{
22742274
get
22752275
{
@@ -2305,12 +2305,12 @@ namespace N
23052305
23062306
public class C : INotifyPropertyChanged
23072307
{
2308-
private string p2;
2309-
private string p3;
2308+
private string? p2;
2309+
private string? p3;
23102310
23112311
public event PropertyChangedEventHandler? PropertyChanged;
23122312
2313-
public IEnumerable<string> P1
2313+
public IEnumerable<string?> P1
23142314
{
23152315
get
23162316
{
@@ -2319,7 +2319,7 @@ public IEnumerable<string> P1
23192319
}
23202320
}
23212321
2322-
public string P2
2322+
public string? P2
23232323
{
23242324
get
23252325
{
@@ -2339,7 +2339,7 @@ public string P2
23392339
}
23402340
}
23412341
2342-
public string P3
2342+
public string? P3
23432343
{
23442344
get
23452345
{
@@ -2381,8 +2381,8 @@ namespace N
23812381
23822382
public class C : INotifyPropertyChanged
23832383
{
2384-
private string firstName;
2385-
private string lastName;
2384+
private string? firstName;
2385+
private string? lastName;
23862386
23872387
public event PropertyChangedEventHandler? PropertyChanged;
23882388
@@ -2394,7 +2394,7 @@ public string FullName
23942394
}
23952395
}
23962396
2397-
public string FirstName
2397+
public string? FirstName
23982398
{
23992399
get
24002400
{
@@ -2413,7 +2413,7 @@ public string FirstName
24132413
}
24142414
}
24152415
2416-
public string LastName
2416+
public string? LastName
24172417
{
24182418
get
24192419
{
@@ -2448,8 +2448,8 @@ namespace N
24482448
24492449
public class C : INotifyPropertyChanged
24502450
{
2451-
private string firstName;
2452-
private string lastName;
2451+
private string? firstName;
2452+
private string? lastName;
24532453
24542454
public event PropertyChangedEventHandler? PropertyChanged;
24552455
@@ -2461,7 +2461,7 @@ public string FullName
24612461
}
24622462
}
24632463
2464-
public string FirstName
2464+
public string? FirstName
24652465
{
24662466
get
24672467
{
@@ -2481,7 +2481,7 @@ public string FirstName
24812481
}
24822482
}
24832483
2484-
public string LastName
2484+
public string? LastName
24852485
{
24862486
get
24872487
{
@@ -2522,11 +2522,11 @@ namespace N
25222522
25232523
public class C : INotifyPropertyChanged
25242524
{
2525-
private string p;
2525+
private string? p;
25262526
25272527
public event PropertyChangedEventHandler? PropertyChanged;
25282528
2529-
public string CalculatedName
2529+
public string? CalculatedName
25302530
{
25312531
get
25322532
{
@@ -2540,7 +2540,7 @@ public string CalculatedName
25402540
}
25412541
}
25422542
2543-
public string P
2543+
public string? P
25442544
{
25452545
get
25462546
{
@@ -2574,11 +2574,11 @@ namespace N
25742574
25752575
public class C : INotifyPropertyChanged
25762576
{
2577-
private string p;
2577+
private string? p;
25782578
25792579
public event PropertyChangedEventHandler? PropertyChanged;
25802580
2581-
public string CalculatedName
2581+
public string? CalculatedName
25822582
{
25832583
get
25842584
{
@@ -2592,7 +2592,7 @@ public string CalculatedName
25922592
}
25932593
}
25942594
2595-
public string P
2595+
public string? P
25962596
{
25972597
get
25982598
{
@@ -2633,8 +2633,8 @@ namespace N
26332633
26342634
public class C : INotifyPropertyChanged
26352635
{
2636-
private string _firstName;
2637-
private string _lastName;
2636+
private string? _firstName;
2637+
private string? _lastName;
26382638
26392639
public event PropertyChangedEventHandler? PropertyChanged;
26402640
@@ -2646,7 +2646,7 @@ public string FullName
26462646
}
26472647
}
26482648
2649-
public string FirstName
2649+
public string? FirstName
26502650
{
26512651
get
26522652
{
@@ -2665,7 +2665,7 @@ public string FirstName
26652665
}
26662666
}
26672667
2668-
public string LastName
2668+
public string? LastName
26692669
{
26702670
get
26712671
{
@@ -2700,8 +2700,8 @@ namespace N
27002700
27012701
public class C : INotifyPropertyChanged
27022702
{
2703-
private string _firstName;
2704-
private string _lastName;
2703+
private string? _firstName;
2704+
private string? _lastName;
27052705
27062706
public event PropertyChangedEventHandler? PropertyChanged;
27072707
@@ -2713,7 +2713,7 @@ public string FullName
27132713
}
27142714
}
27152715
2716-
public string FirstName
2716+
public string? FirstName
27172717
{
27182718
get
27192719
{
@@ -2733,7 +2733,7 @@ public string FirstName
27332733
}
27342734
}
27352735
2736-
public string LastName
2736+
public string? LastName
27372737
{
27382738
get
27392739
{

PropertyChangedAnalyzers.Test/INPC005CheckIfDifferentBeforeNotifying/Valid.CaliburnMicro.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ namespace N
1818
{
1919
public class C : Caliburn.Micro.PropertyChangedBase
2020
{
21-
private string p2;
21+
private int p2;
2222
2323
public string P1 => $""Hello {this.P2}"";
2424
25-
public string P2
25+
public int P2
2626
{
2727
get { return this.p2; }
2828
set
@@ -46,11 +46,11 @@ namespace N
4646
{
4747
public class C : Caliburn.Micro.PropertyChangedBase
4848
{
49-
private string p2;
49+
private int p2;
5050
5151
public string P1 => $""Hello {this.P2}"";
5252
53-
public string P2
53+
public int P2
5454
{
5555
get { return this.p2; }
5656
set
@@ -74,13 +74,13 @@ namespace N
7474
{
7575
public class C : Caliburn.Micro.PropertyChangedBase
7676
{
77-
private string p3;
77+
private int p3;
7878
7979
public string P1 => $""Hello {this.P3}"";
8080
8181
public string P2 => $""Hej {this.P3}"";
8282
83-
public string P3
83+
public int P3
8484
{
8585
get { return this.p3; }
8686
set
@@ -105,13 +105,13 @@ namespace N
105105
{
106106
public class C : Caliburn.Micro.PropertyChangedBase
107107
{
108-
private string p3;
108+
private int p3;
109109
110110
public string P1 => $""Hello {this.P3}"";
111111
112112
public string P2 => $""Hej {this.P3}"";
113113
114-
public string P3
114+
public int P3
115115
{
116116
get { return this.p3; }
117117
set
@@ -136,12 +136,12 @@ namespace N
136136
{
137137
public class C : Caliburn.Micro.PropertyChangedBase
138138
{
139-
private string firstName;
140-
private string lastName;
139+
private string? firstName;
140+
private string? lastName;
141141
142142
public string FullName => $""{this.FirstName} {this.LastName}"";
143143
144-
public string FirstName
144+
public string? FirstName
145145
{
146146
get
147147
{
@@ -161,7 +161,7 @@ public string FirstName
161161
}
162162
}
163163
164-
public string LastName
164+
public string? LastName
165165
{
166166
get
167167
{
@@ -193,11 +193,11 @@ namespace N
193193
{
194194
public class C : Caliburn.Micro.PropertyChangedBase
195195
{
196-
private string p2;
196+
private int p2;
197197
198198
public string P1 => $""Hello {this.P2}"";
199199
200-
public string P2
200+
public int P2
201201
{
202202
get { return this.p2; }
203203
set

0 commit comments

Comments
 (0)