Skip to content

Commit b5b55fd

Browse files
committed
Annotate test code.
1 parent d1ee829 commit b5b55fd

10 files changed

Lines changed: 62 additions & 73 deletions

File tree

PropertyChangedAnalyzers.Test/INPC010GetAndSetSame/Valid.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ public static void WithBackingFieldStatementBodies()
5858
var code = @"
5959
namespace N
6060
{
61-
using System.ComponentModel;
62-
using System.Runtime.CompilerServices;
63-
6461
public class C
6562
{
6663
private int p;
@@ -82,9 +79,6 @@ public static void WithBackingFieldStatementBodiesAssigningTwice()
8279
var code = @"
8380
namespace N
8481
{
85-
using System.ComponentModel;
86-
using System.Runtime.CompilerServices;
87-
8882
public class C
8983
{
9084
private int p;

PropertyChangedAnalyzers.Test/INPC011DoNotShadow/Valid.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace PropertyChangedAnalyzers.Test.INPC011DoNotShadow
1+
namespace PropertyChangedAnalyzers.Test.INPC011DoNotShadow
22
{
33
using Gu.Roslyn.Asserts;
44
using NUnit.Framework;
@@ -72,6 +72,7 @@ protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName
7272
}";
7373

7474
var code = @"
75+
#pragma warning disable CS0067
7576
namespace N
7677
{
7778
using System.ComponentModel;

PropertyChangedAnalyzers.Test/INPC012DoNotUseExpression/Codefix.CaliburnMicro.cs

Lines changed: 8 additions & 8 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 string? p2;
2222
2323
public string P1 => $""Hello {this.p2}"";
2424
25-
public string P2
25+
public string? P2
2626
{
2727
get { return this.p2; }
2828
set
@@ -41,11 +41,11 @@ namespace N
4141
{
4242
public class C : Caliburn.Micro.PropertyChangedBase
4343
{
44-
private string p2;
44+
private string? p2;
4545
4646
public string P1 => $""Hello {this.p2}"";
4747
48-
public string P2
48+
public string? P2
4949
{
5050
get { return this.p2; }
5151
set
@@ -69,11 +69,11 @@ namespace N
6969
{
7070
internal class C : Caliburn.Micro.PropertyChangedBase
7171
{
72-
private string p2;
72+
private string? p2;
7373
7474
public string P1 => $""Hello {this.p2}"";
7575
76-
internal string P2
76+
internal string? P2
7777
{
7878
get { return this.p2; }
7979
set
@@ -92,11 +92,11 @@ namespace N
9292
{
9393
internal class C : Caliburn.Micro.PropertyChangedBase
9494
{
95-
private string p2;
95+
private string? p2;
9696
9797
public string P1 => $""Hello {this.p2}"";
9898
99-
internal string P2
99+
internal string? P2
100100
{
101101
get { return this.p2; }
102102
set

PropertyChangedAnalyzers.Test/INPC012DoNotUseExpression/Codefix.MvvmCrossCore.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ namespace N
1818
{
1919
public class C : MvvmCross.ViewModels.MvxNotifyPropertyChanged
2020
{
21-
private string p2;
21+
private string? p2;
2222
2323
public string P1=> $""Hello {this.p2}"";
2424
25-
public string P2
25+
public string? P2
2626
{
2727
get { return this.p2; }
2828
set
@@ -41,11 +41,11 @@ namespace N
4141
{
4242
public class C : MvvmCross.ViewModels.MvxNotifyPropertyChanged
4343
{
44-
private string p2;
44+
private string? p2;
4545
4646
public string P1=> $""Hello {this.p2}"";
4747
48-
public string P2
48+
public string? P2
4949
{
5050
get { return this.p2; }
5151
set
@@ -69,11 +69,11 @@ namespace N
6969
{
7070
internal class C : MvvmCross.ViewModels.MvxNotifyPropertyChanged
7171
{
72-
private string p2;
72+
private string? p2;
7373
7474
public string P1=> $""Hello {this.p2}"";
7575
76-
internal string P2
76+
internal string? P2
7777
{
7878
get { return this.p2; }
7979
set
@@ -92,11 +92,11 @@ namespace N
9292
{
9393
internal class C : MvvmCross.ViewModels.MvxNotifyPropertyChanged
9494
{
95-
private string p2;
95+
private string? p2;
9696
9797
public string P1=> $""Hello {this.p2}"";
9898
99-
internal string P2
99+
internal string? P2
100100
{
101101
get { return this.p2; }
102102
set

PropertyChangedAnalyzers.Test/INPC012DoNotUseExpression/Codefix.MvvmLight.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ namespace N
1818
{
1919
public class C : GalaSoft.MvvmLight.ViewModelBase
2020
{
21-
private string p2;
21+
private string? p2;
2222
2323
public string P1 => $""Hello {this.p2}"";
2424
25-
public string P2
25+
public string? P2
2626
{
2727
get { return this.p2; }
2828
set
@@ -41,11 +41,11 @@ namespace N
4141
{
4242
public class C : GalaSoft.MvvmLight.ViewModelBase
4343
{
44-
private string p2;
44+
private string? p2;
4545
4646
public string P1 => $""Hello {this.p2}"";
4747
48-
public string P2
48+
public string? P2
4949
{
5050
get { return this.p2; }
5151
set
@@ -69,11 +69,11 @@ namespace N
6969
{
7070
internal class C : GalaSoft.MvvmLight.ViewModelBase
7171
{
72-
private string p2;
72+
private string? p2;
7373
7474
public string P1 => $""Hello {this.p2}"";
7575
76-
internal string P2
76+
internal string? P2
7777
{
7878
get { return this.p2; }
7979
set
@@ -92,11 +92,11 @@ namespace N
9292
{
9393
internal class C : GalaSoft.MvvmLight.ViewModelBase
9494
{
95-
private string p2;
95+
private string? p2;
9696
9797
public string P1 => $""Hello {this.p2}"";
9898
99-
internal string P2
99+
internal string? P2
100100
{
101101
get { return this.p2; }
102102
set

PropertyChangedAnalyzers.Test/INPC012DoNotUseExpression/Codefix.StyletMvvm.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ namespace N
1818
{
1919
public class C : Stylet.PropertyChangedBase
2020
{
21-
private string p2;
21+
private string? p2;
2222
2323
public string P1 => $""Hello {this.p2}"";
2424
25-
public string P2
25+
public string? P2
2626
{
2727
get { return this.p2; }
2828
set
@@ -41,11 +41,11 @@ namespace N
4141
{
4242
public class C : Stylet.PropertyChangedBase
4343
{
44-
private string p2;
44+
private string? p2;
4545
4646
public string P1 => $""Hello {this.p2}"";
4747
48-
public string P2
48+
public string? P2
4949
{
5050
get { return this.p2; }
5151
set
@@ -69,11 +69,11 @@ namespace N
6969
{
7070
internal class C : Stylet.PropertyChangedBase
7171
{
72-
private string p2;
72+
private string? p2;
7373
7474
public string P1 => $""Hello {this.p2}"";
7575
76-
internal string P2
76+
internal string? P2
7777
{
7878
get { return this.p2; }
7979
set
@@ -92,11 +92,11 @@ namespace N
9292
{
9393
internal class C : Stylet.PropertyChangedBase
9494
{
95-
private string p2;
95+
private string? p2;
9696
9797
public string P1 => $""Hello {this.p2}"";
9898
99-
internal string P2
99+
internal string? P2
100100
{
101101
get { return this.p2; }
102102
set

PropertyChangedAnalyzers.Test/INPC012DoNotUseExpression/Codefix.ViewModelBase.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ namespace N.Client
5252
{
5353
public class C : N.Core.ViewModelBase
5454
{
55-
private string p2;
55+
private string? p2;
5656
5757
public string P1 => $""Hello {this.p2}"";
5858
59-
public string P2
59+
public string? P2
6060
{
6161
get { return this.p2; }
6262
set
@@ -75,11 +75,11 @@ namespace N.Client
7575
{
7676
public class C : N.Core.ViewModelBase
7777
{
78-
private string p2;
78+
private string? p2;
7979
8080
public string P1 => $""Hello {this.p2}"";
8181
82-
public string P2
82+
public string? P2
8383
{
8484
get { return this.p2; }
8585
set
@@ -103,11 +103,11 @@ namespace N.Client
103103
{
104104
internal class C : N.Core.ViewModelBase
105105
{
106-
private string p2;
106+
private string? p2;
107107
108108
internal string P1 => $""Hello {this.p2}"";
109109
110-
internal string P2
110+
internal string? P2
111111
{
112112
get { return this.p2; }
113113
set
@@ -126,11 +126,11 @@ namespace N.Client
126126
{
127127
internal class C : N.Core.ViewModelBase
128128
{
129-
private string p2;
129+
private string? p2;
130130
131131
internal string P1 => $""Hello {this.p2}"";
132132
133-
internal string P2
133+
internal string? P2
134134
{
135135
get { return this.p2; }
136136
set

PropertyChangedAnalyzers.Test/INPC012DoNotUseExpression/Codefix.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace PropertyChangedAnalyzers.Test.INPC012DoNotUseExpression
1+
namespace PropertyChangedAnalyzers.Test.INPC012DoNotUseExpression
22
{
33
using Gu.Roslyn.Asserts;
44
using NUnit.Framework;
@@ -418,13 +418,13 @@ namespace N
418418
419419
public class C : INotifyPropertyChanged
420420
{
421-
private string p2;
421+
private string? p2;
422422
423423
public event PropertyChangedEventHandler? PropertyChanged;
424424
425425
public string P1 => $""Hello { this.P2}"";
426426
427-
public string P2
427+
public string? P2
428428
{
429429
get
430430
{
@@ -466,13 +466,13 @@ namespace N
466466
467467
public class C : INotifyPropertyChanged
468468
{
469-
private string p2;
469+
private string? p2;
470470
471471
public event PropertyChangedEventHandler? PropertyChanged;
472472
473473
public string P1 => $""Hello { this.P2}"";
474474
475-
public string P2
475+
public string? P2
476476
{
477477
get
478478
{

0 commit comments

Comments
 (0)