Skip to content

Commit

Permalink
Update RSPEC + more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
zsolt-kolbay-sonarsource committed Apr 30, 2024
1 parent e9cf7d8 commit 52bf94d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion analyzers/rspec/cs/S6964.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title": "Value type properties of a model class should be nullable or marked as \"Required\" to avoid under-posting",
"title": "Property used as input in a controller action should be nullable or annotated with the Required attribute to avoid under-posting.",
"type": "CODE_SMELL",
"status": "ready",
"remediation": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,13 @@ public class Model<T> where T : Person

public abstract class Person
{
public int Age { get; set; } // Noncompliant
public int Age { get; set; } // Noncompliant
}

public class Developer : Person
{
public string ProgramingLanguage { get; set; }
public int WorkExperienceInYears { get; set; } // Noncompliant
}
}

Expand All @@ -194,7 +195,7 @@ public void Create(MyModel model)
public class Model<T> where T : Model<T>
{
public Model<T> SubModel { get; set; }
public int ValueProperty { get; set; } // Noncompliant
public int ValueProperty { get; set; } // Noncompliant
}

public class MyModel : Model<MyModel>
Expand Down

0 comments on commit 52bf94d

Please sign in to comment.