Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
jerviscui committed May 28, 2024
1 parent e8bd45c commit 95216ee
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -852,3 +852,6 @@ dotnet_diagnostic.S3923.severity = error

# S4158: Empty collections should not be accessed or iterated
dotnet_diagnostic.S4158.severity = error

# S2696: Instance members should not write to "static" fields
dotnet_diagnostic.S2696.severity = error
37 changes: 34 additions & 3 deletions src/Tests/CodeAnalysisTest/OrganizeMembersTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ namespace CodeAnalysisTest;
/// <summary>
/// Organize members test case
/// </summary>
public class OrganizeMembersTest : IExplicit, IImplicit
public class OrganizeMembersTest : IExplicit, IImplicit, IPropInterface
{
private bool _boolProp;
public bool BoolProp
{
get => _boolProp;
set => _boolProp = value;
set => _boolProp = value && false;
}

/// <summary>
Expand All @@ -25,7 +25,7 @@ public bool BoolProp
public string StrProp
{
get => _strProp;
set => _strProp = value;
set => _strProp = value + "";
}

/// <summary>
Expand All @@ -49,6 +49,9 @@ public OrganizeMembersTest(bool boolProp, string strProp, int myField)
_field2 = 0;

PublicMehtod();

InterfaceProp = string.Empty;
InterfaceProp2 = string.Empty;
}

// Field3
Expand Down Expand Up @@ -118,6 +121,12 @@ Task IImplicit.TaskMethodAsync(CancellationToken cancellationToken)

throw new NotImplementedException();
}

/// <inheritdoc/>
public string InterfaceProp { get; set; }

/// <inheritdoc/>
public string InterfaceProp2 { get; set; }
}

/// <summary>
Expand All @@ -142,4 +151,26 @@ public interface IImplicit
/// </summary>
/// <returns></returns>
public Task TaskMethodAsync(CancellationToken cancellationToken);

/// <summary>
/// Interface has method and property.
/// </summary>
/// <value>
/// The interface property.
/// </value>
public string InterfaceProp2 { get; set; }
}

/// <summary>
/// Prop Interface
/// </summary>
public interface IPropInterface
{
/// <summary>
/// Gets or sets the interface property.
/// </summary>
/// <value>
/// The interface property.
/// </value>
public string InterfaceProp { get; set; }
}

0 comments on commit 95216ee

Please sign in to comment.