Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
jerviscui committed Jun 3, 2024
1 parent 7c78579 commit 566ba96
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions src/Tests/CodeAnalysisTest/OrganizeMembersTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,41 +20,47 @@ internal void SetProps()
}

private bool _boolProp;

public bool BoolProp
{
get => _boolProp;
set => _boolProp = value && false;
}

private int _privateProp;

private int PrivateProp
{
get => _privateProp;
set => _privateProp = value + 1;
}

private int _protectedProp;

protected int ProtectedProp
{
get => _protectedProp;
set => _protectedProp = value + 1;
}

private int _proInternalProp;

protected internal int ProInternalProp
{
get => _proInternalProp;
set => _proInternalProp = value + 1;
}

private int _internalProp;

internal int InternalProp
{
get => _internalProp;
set => _internalProp = value + 1;
}

private int _publicProp;

public int PublicProp
{
get => _publicProp;
Expand All @@ -65,6 +71,7 @@ public int PublicProp
/// The string property
/// </summary>
private string _strProp;

/// <summary>
/// Gets or sets the string property.
/// </summary>
Expand All @@ -75,7 +82,7 @@ public string StrProp
{
get => _strProp;

[MemberNotNull(nameof(_strProp))]
[MemberNotNull(nameof(_strProp))]
set => _strProp = $"{value}";
}

Expand All @@ -84,6 +91,13 @@ public string StrProp
/// </summary>
private readonly int _myField;

static OrganizeMembersTest()
{
PublicStaticMehtod();
string varName = "Hello";
PrivateStaticMehtod();
}

private OrganizeMembersTest()
{
SetProps();
Expand Down Expand Up @@ -181,6 +195,15 @@ public static void PublicStaticMehtod()
Field4 = "Hello";
}

/// <summary>
/// Private static mehtod.
/// </summary>
/// <param name="hello"></param>
private static void PrivateStaticMehtod(string hello)
{
Field4 = hello;
}

/// <summary>
/// The field2
/// </summary>
Expand All @@ -201,7 +224,7 @@ Task IImplicit.TaskMethodAsync(CancellationToken cancellationToken)
}

cancellationToken.ThrowIfCancellationRequested();
rtag:
rtag:
throw new NotImplementedException();
}

Expand All @@ -215,6 +238,7 @@ public Task TaskMethod2Async(CancellationToken cancellationToken)

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

/// <inheritdoc />
public string InterfaceProp1 { get; set; }
}
Expand Down

0 comments on commit 566ba96

Please sign in to comment.