-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for INPC005 MvvmCross.SetProperty #123
Labels
Comments
JohanLarsson
changed the title
Handle MvvmCross.SetProperty
Fix for INPC005 MvvmCross.SetProperty
Aug 18, 2019
[Test]
public static void NoCheckToUseSetAndRaise()
{
var before = @"
namespace RoslynSandbox
{
public class ViewModel : MvvmCross.ViewModels.MvxNotifyPropertyChanged
{
private string name;
public string Name
{
get => this.name;
set
{
this.name = value;
↓this.RaisePropertyChanged();
}
}
}
}";
var after = @"
namespace RoslynSandbox
{
public class ViewModel : MvvmCross.ViewModels.MvxNotifyPropertyChanged
{
private string name;
public string Name
{
get => this.name;
set => this.SetProperty(ref this.name, value);
}
}
}";
RoslynAssert.CodeFix(Analyzer, Fix, ExpectedDiagnostic, before, after, fixTitle: "Use MvxNotifyPropertyChanged.SetProperty");
RoslynAssert.FixAll(Analyzer, Fix, ExpectedDiagnostic, before, after, fixTitle: "Use MvxNotifyPropertyChanged.SetProperty");
} |
[Test]
public static void NoCheckExpressionToUseSetAndRaise()
{
var before = @"
namespace RoslynSandbox
{
public class ViewModel : MvvmCross.ViewModels.MvxNotifyPropertyChanged
{
private string name;
public string Name
{
get => this.name;
set
{
this.name = value;
↓this.RaisePropertyChanged(() => this.Name);
}
}
}
}";
var after = @"
namespace RoslynSandbox
{
public class ViewModel : MvvmCross.ViewModels.MvxNotifyPropertyChanged
{
private string name;
public string Name
{
get => this.name;
set => this.SetProperty(ref this.name, value);
}
}
}";
RoslynAssert.CodeFix(Analyzer, Fix, ExpectedDiagnostic, before, after, fixTitle: "Use MvxNotifyPropertyChanged.SetProperty");
RoslynAssert.FixAll(Analyzer, Fix, ExpectedDiagnostic, before, after, fixTitle: "Use MvxNotifyPropertyChanged.SetProperty");
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not sure what we should pass as action, maybe
null
. Waiting with support for this.The text was updated successfully, but these errors were encountered: