-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
namespace CodeAnalysisTest; | ||
|
||
public class OrganizeMembersTest | ||
{ | ||
// IDE0001 dotnet_style_predefined_type_for_locals_parameters_members = true | ||
private int _id; | ||
|
||
// IDE0001 dotnet_style_predefined_type_for_locals_parameters_members = true | ||
public int ID | ||
{ | ||
get => _id; | ||
set => _id = value; | ||
} | ||
|
||
// IDE0001 dotnet_style_predefined_type_for_locals_parameters_members = true | ||
public void Display() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
// IDE0001 dotnet_style_predefined_type_for_locals_parameters_members = true | ||
public event EventHandler MyEvent; | ||
|
||
// IDE0001 dotnet_style_predefined_type_for_locals_parameters_members = true | ||
private static bool Test() | ||
{ | ||
// ide0007 csharp_style_var_for_built_in_types = true | ||
int x = 5; | ||
int y = x; | ||
|
||
// ide0007 csharp_style_var_when_type_is_apparent = true | ||
MyClass obj = new MyClass(); | ||
var yy = obj.Age; | ||
|
||
// ide0007 csharp_style_var_elsewhere = true | ||
bool f = Random.Shared.Next() > 1; | ||
var yyy = f; | ||
|
||
return true; | ||
} | ||
} |