Skip to content

Commit 835a6be

Browse files
committed
Annotate test code.
1 parent c8bb859 commit 835a6be

2 files changed

Lines changed: 22 additions & 22 deletions

File tree

PropertyChangedAnalyzers.Test/INPC004UseCallerMemberName/FixAll.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,11 @@ namespace N.Client
165165
{
166166
public class C : N.Core.ViewModelBase
167167
{
168-
private string p2;
168+
private int p2;
169169
170170
public string P1 => $""Hello {this.P2}"";
171171
172-
public string P2
172+
public int P2
173173
{
174174
get { return this.p2; }
175175
set
@@ -188,11 +188,11 @@ namespace N.Client
188188
{
189189
public class C : N.Core.ViewModelBase
190190
{
191-
private string p2;
191+
private int p2;
192192
193193
public string P1 => $""Hello {this.P2}"";
194194
195-
public string P2
195+
public int P2
196196
{
197197
get { return this.p2; }
198198
set

PropertyChangedAnalyzers.Test/INPC004UseCallerMemberName/Valid{T}.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
namespace PropertyChangedAnalyzers.Test.INPC004UseCallerMemberName
1+
namespace PropertyChangedAnalyzers.Test.INPC004UseCallerMemberName
22
{
33
using Gu.Roslyn.Asserts;
44
using Microsoft.CodeAnalysis.Diagnostics;
55
using NUnit.Framework;
6+
using PropertyChangedAnalyzers.Test.Helpers;
67

78
[TestFixture(typeof(ArgumentAnalyzer))]
89
[TestFixture(typeof(MethodDeclarationAnalyzer))]
@@ -23,7 +24,6 @@ public static void CallsRaisePropertyChangedWithEventArgs(string propertyName)
2324
namespace N
2425
{
2526
using System.ComponentModel;
26-
using System.Runtime.CompilerServices;
2727
2828
public class C : INotifyPropertyChanged
2929
{
@@ -175,11 +175,11 @@ namespace N
175175
176176
public class C : INotifyPropertyChanged
177177
{
178-
private string text;
178+
private string? text;
179179
180180
public event PropertyChangedEventHandler? PropertyChanged;
181181
182-
public string Text
182+
public string? Text
183183
{
184184
get
185185
{
@@ -331,9 +331,9 @@ namespace N
331331
332332
internal class CellTemplateColumn : DataGridTemplateColumn
333333
{
334-
private BindingBase binding;
334+
private BindingBase? binding;
335335
336-
public BindingBase Binding
336+
public BindingBase? Binding
337337
{
338338
get
339339
{
@@ -351,25 +351,25 @@ public BindingBase Binding
351351
}
352352
}
353353
354-
public override BindingBase ClipboardContentBinding
354+
public override BindingBase? ClipboardContentBinding
355355
{
356-
get { return base.ClipboardContentBinding ?? this.Binding; }
356+
get { return base.ClipboardContentBinding ?? this.binding; }
357357
set { base.ClipboardContentBinding = value; }
358358
}
359359
360-
protected override FrameworkElement GenerateEditingElement(DataGridCell cell, object dataItem)
360+
protected override FrameworkElement? GenerateEditingElement(DataGridCell cell, object dataItem)
361361
{
362362
return this.LoadTemplateContent(true, dataItem, cell);
363363
}
364364
365-
protected override FrameworkElement GenerateElement(DataGridCell cell, object dataItem)
365+
protected override FrameworkElement? GenerateElement(DataGridCell cell, object dataItem)
366366
{
367367
return this.LoadTemplateContent(false, dataItem, cell);
368368
}
369369
370-
private DataTemplate ChooseCellTemplate(bool isEditing)
370+
private DataTemplate? ChooseCellTemplate(bool isEditing)
371371
{
372-
DataTemplate template = null;
372+
DataTemplate? template = null;
373373
if (isEditing)
374374
{
375375
template = this.CellEditingTemplate;
@@ -383,9 +383,9 @@ private DataTemplate ChooseCellTemplate(bool isEditing)
383383
return template;
384384
}
385385
386-
private DataTemplateSelector ChooseCellTemplateSelector(bool isEditing)
386+
private DataTemplateSelector? ChooseCellTemplateSelector(bool isEditing)
387387
{
388-
DataTemplateSelector templateSelector = null;
388+
DataTemplateSelector? templateSelector = null;
389389
if (isEditing)
390390
{
391391
templateSelector = this.CellEditingTemplateSelector;
@@ -400,7 +400,7 @@ private DataTemplateSelector ChooseCellTemplateSelector(bool isEditing)
400400
}
401401
402402
[SuppressMessage(""ReSharper"", ""UnusedParameter.Local"")]
403-
private FrameworkElement LoadTemplateContent(bool isEditing, object dataItem, DataGridCell cell)
403+
private FrameworkElement? LoadTemplateContent(bool isEditing, object dataItem, DataGridCell cell)
404404
{
405405
var template = this.ChooseCellTemplate(isEditing);
406406
var templateSelector = this.ChooseCellTemplateSelector(isEditing);
@@ -473,14 +473,14 @@ namespace N
473473
474474
public class ExceptionHandlingRelayCommand : ConditionRelayCommand
475475
{
476-
private Exception _exception;
476+
private Exception? _exception;
477477
478478
public ExceptionHandlingRelayCommand(Action action, ICondition condition)
479479
: base(action, condition)
480480
{
481481
}
482482
483-
public Exception Exception
483+
public Exception? Exception
484484
{
485485
get => _exception;
486486
@@ -498,7 +498,7 @@ private set
498498
}
499499
}";
500500

501-
RoslynAssert.Valid(Analyzer, code);
501+
RoslynAssert.Valid(Analyzer, code, settings: LibrarySettings.Reactive);
502502
}
503503
}
504504
}

0 commit comments

Comments
 (0)