Skip to content

Commit 884fd8a

Browse files
committed
Annotate test code.
1 parent ce366e1 commit 884fd8a

14 files changed

Lines changed: 193 additions & 191 deletions

File tree

PropertyChangedAnalyzers.Test/INPC003NotifyForDependentProperty/Valid.Ignore.cs

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,15 @@ public DelegateCommand(Func<object, bool> func)
104104
throw new NotImplementedException();
105105
}
106106
107-
public event EventHandler CanExecuteChanged;
107+
#pragma warning disable CS0067
108+
public event EventHandler? CanExecuteChanged;
108109
109-
public bool CanExecute(object parameter)
110+
public bool CanExecute(object? parameter)
110111
{
111112
throw new NotImplementedException();
112113
}
113114
114-
public void Execute(object parameter)
115+
public void Execute(object? parameter)
115116
{
116117
throw new NotImplementedException();
117118
}
@@ -126,7 +127,7 @@ namespace N
126127
public class C : INotifyPropertyChanged
127128
{
128129
private bool p;
129-
private DelegateCommand command;
130+
private DelegateCommand? command;
130131
131132
public event PropertyChangedEventHandler? PropertyChanged;
132133
@@ -184,14 +185,15 @@ public DelegateCommand(Func<object, bool> func)
184185
throw new NotImplementedException();
185186
}
186187
187-
public event EventHandler CanExecuteChanged;
188+
#pragma warning disable CS0067
189+
public event EventHandler? CanExecuteChanged;
188190
189-
public bool CanExecute(object parameter)
191+
public bool CanExecute(object? parameter)
190192
{
191193
throw new NotImplementedException();
192194
}
193195
194-
public void Execute(object parameter)
196+
public void Execute(object? parameter)
195197
{
196198
throw new NotImplementedException();
197199
}
@@ -205,8 +207,8 @@ namespace N
205207
206208
public class C : INotifyPropertyChanged
207209
{
210+
private DelegateCommand? p1;
208211
private bool p2;
209-
private DelegateCommand p1;
210212
211213
public event PropertyChangedEventHandler? PropertyChanged;
212214
@@ -259,14 +261,15 @@ public DelegateCommand(Func<object, bool> func)
259261
throw new NotImplementedException();
260262
}
261263
262-
public event EventHandler CanExecuteChanged;
264+
#pragma warning disable CS0067
265+
public event EventHandler? CanExecuteChanged;
263266
264-
public bool CanExecute(object parameter)
267+
public bool CanExecute(object? parameter)
265268
{
266269
throw new NotImplementedException();
267270
}
268271
269-
public void Execute(object parameter)
272+
public void Execute(object? parameter)
270273
{
271274
throw new NotImplementedException();
272275
}
@@ -281,11 +284,11 @@ namespace N
281284
public class C : INotifyPropertyChanged
282285
{
283286
private bool p;
284-
private DelegateCommand pCommand;
287+
private DelegateCommand? command;
285288
286289
public event PropertyChangedEventHandler? PropertyChanged;
287290
288-
public DelegateCommand PCommand => this.pCommand ?? (this.pCommand = new DelegateCommand(param => this.P = true));
291+
public DelegateCommand Command => this.command ?? (this.command = new DelegateCommand(param => this.P = true));
289292
290293
public bool P
291294
{
@@ -453,11 +456,11 @@ namespace N
453456
454457
public class C : INotifyPropertyChanged
455458
{
456-
private string p;
459+
private string? p;
457460
458461
public event PropertyChangedEventHandler? PropertyChanged;
459462
460-
public string P
463+
public string? P
461464
{
462465
get
463466
{
@@ -491,7 +494,7 @@ namespace N
491494
492495
public class C : INotifyPropertyChanged
493496
{
494-
private string p;
497+
private string? p;
495498
496499
public event PropertyChangedEventHandler? PropertyChanged;
497500

PropertyChangedAnalyzers.Test/INPC003NotifyForDependentProperty/Valid.MvvmCrossCore.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ namespace N
1818
{
1919
public class C : MvvmCross.ViewModels.MvxNotifyPropertyChanged
2020
{
21-
private string p;
21+
private string? p;
2222
23-
public string P
23+
public string? P
2424
{
2525
get { return this.p; }
2626
set { this.SetProperty(ref this.p, value); }
@@ -38,9 +38,9 @@ namespace N
3838
{
3939
public class C : MvvmCross.ViewModels.MvxNotifyPropertyChanged
4040
{
41-
private string p;
41+
private string? p;
4242
43-
public string P
43+
public string? P
4444
{
4545
get => this.p;
4646
set => this.SetProperty(ref this.p, value);
@@ -58,11 +58,11 @@ namespace N
5858
{
5959
public class C : MvvmCross.ViewModels.MvxNotifyPropertyChanged
6060
{
61-
private string p2;
61+
private string? p2;
6262
6363
public string P1 => $""Hello {this.P2}"";
6464
65-
public string P2
65+
public string? P2
6666
{
6767
get { return this.p2; }
6868
set
@@ -86,11 +86,11 @@ namespace N
8686
{
8787
public class C : MvvmCross.ViewModels.MvxNotifyPropertyChanged
8888
{
89-
private string p2;
89+
private string? p2;
9090
9191
public string P1 => $""Hello{this.P2}"";
9292
93-
public string P2
93+
public string? P2
9494
{
9595
get { return this.p2; }
9696
set

PropertyChangedAnalyzers.Test/INPC003NotifyForDependentProperty/Valid.MvvmLight.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ namespace N
1818
{
1919
public class C : GalaSoft.MvvmLight.ViewModelBase
2020
{
21-
private string p;
21+
private string? p;
2222
23-
public string P
23+
public string? P
2424
{
2525
get { return this.p; }
2626
set { this.Set(ref this.p, value); }
@@ -38,9 +38,9 @@ namespace N
3838
{
3939
public class C : GalaSoft.MvvmLight.ViewModelBase
4040
{
41-
private string p;
41+
private string? p;
4242
43-
public string P
43+
public string? P
4444
{
4545
get => this.p;
4646
set => this.Set(ref this.p, value);
@@ -58,11 +58,11 @@ namespace N
5858
{
5959
public class C : GalaSoft.MvvmLight.ViewModelBase
6060
{
61-
private string p2;
61+
private string? p2;
6262
6363
public string P1 => $""Hello {this.P2}"";
6464
65-
public string P2
65+
public string? P2
6666
{
6767
get { return this.p2; }
6868
set
@@ -86,11 +86,11 @@ namespace N
8686
{
8787
public class C : GalaSoft.MvvmLight.ViewModelBase
8888
{
89-
private string p2;
89+
private string? p2;
9090
9191
public string P1 => $""Hello{this.P2}"";
9292
93-
public string P2
93+
public string? P2
9494
{
9595
get { return this.p2; }
9696
set

PropertyChangedAnalyzers.Test/INPC003NotifyForDependentProperty/Valid.PrismBindableBase.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ namespace N
1818
{
1919
public class C : Microsoft.Practices.Prism.Mvvm.BindableBase
2020
{
21-
private string p;
21+
private string? p;
2222
23-
public string P
23+
public string? P
2424
{
2525
get { return this.p; }
2626
set { this.SetProperty(ref this.p, value); }
@@ -38,9 +38,9 @@ namespace N
3838
{
3939
public class C : Microsoft.Practices.Prism.Mvvm.BindableBase
4040
{
41-
private string p;
41+
private string? p;
4242
43-
public string P
43+
public string? P
4444
{
4545
get => this.p;
4646
set => this.SetProperty(ref this.p, value);
@@ -58,11 +58,11 @@ namespace N
5858
{
5959
public class C : Microsoft.Practices.Prism.Mvvm.BindableBase
6060
{
61-
private string p2;
61+
private string? p2;
6262
6363
public string P1 => $""Hello {this.P2}"";
6464
65-
public string P2
65+
public string? P2
6666
{
6767
get { return this.p2; }
6868
set
@@ -86,11 +86,11 @@ namespace N
8686
{
8787
public class C : Microsoft.Practices.Prism.Mvvm.BindableBase
8888
{
89-
private string p2;
89+
private string? p2;
9090
9191
public string P1 => $""Hello{this.P2}"";
9292
93-
public string P2
93+
public string? P2
9494
{
9595
get { return this.p2; }
9696
set

PropertyChangedAnalyzers.Test/INPC003NotifyForDependentProperty/Valid.StyletMvvm.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ namespace N
1818
{
1919
public class C : Stylet.PropertyChangedBase
2020
{
21-
private string p;
21+
private string? p;
2222
23-
public string P
23+
public string? P
2424
{
2525
get { return this.p; }
2626
set { this.SetAndNotify(ref this.p, value); }
@@ -38,9 +38,9 @@ namespace N
3838
{
3939
public class C : Stylet.PropertyChangedBase
4040
{
41-
private string p;
41+
private string? p;
4242
43-
public string P
43+
public string? P
4444
{
4545
get => this.p;
4646
set => this.SetAndNotify(ref this.p, value);
@@ -58,11 +58,11 @@ namespace N
5858
{
5959
public class C : Stylet.PropertyChangedBase
6060
{
61-
private string p2;
61+
private string? p2;
6262
6363
public string P1 => $""Hello {this.P2}"";
6464
65-
public string P2
65+
public string? P2
6666
{
6767
get { return this.p2; }
6868
set
@@ -86,11 +86,11 @@ namespace N
8686
{
8787
public class C : Stylet.PropertyChangedBase
8888
{
89-
private string p2;
89+
private string? p2;
9090
9191
public string P1 => $""Hello {this.P2}"";
9292
93-
public string P2
93+
public string? P2
9494
{
9595
get => this.p2;
9696
set => this.SetAndNotify(ref this.p2, value, string.Empty);
@@ -108,11 +108,11 @@ namespace N
108108
{
109109
public class C : Stylet.PropertyChangedBase
110110
{
111-
private string p2;
111+
private string? p2;
112112
113113
public string P1 => $""Hello{this.P2}"";
114114
115-
public string P2
115+
public string? P2
116116
{
117117
get { return this.p2; }
118118
set

0 commit comments

Comments
 (0)