-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#113 - expose IProperty.GetMethod and IProperty.SetMethod and
- Loading branch information
Showing
10 changed files
with
123 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
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
10 changes: 10 additions & 0 deletions
10
NTypewriter.CodeModel.Tests/Property/GetMethod_IsPublic/expectedResult.txt
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,10 @@ | ||
PropGetSet true | ||
PropGet true | ||
PropGetInternalSet true | ||
PropGetPrivateSet true | ||
PropGetProtectedSet true | ||
PropGetInit true | ||
PropRequiredGetSet false | ||
PropRequiredGetInit false | ||
ProtectedPropGetSet false | ||
InternalPropGetSet false |
25 changes: 25 additions & 0 deletions
25
NTypewriter.CodeModel.Tests/Property/GetMethod_IsPublic/inputCode.cs
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,25 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace NTypewriter.Tests.CodeModel | ||
{ | ||
|
||
|
||
|
||
class SampleClass | ||
{ | ||
public int PropGetSet { get; set; } | ||
public int PropGet { get; } | ||
public int PropGetInternalSet { get; internal set; } | ||
public int PropGetPrivateSet { get; private set; } | ||
public int PropGetProtectedSet { get; protected set; } | ||
public int PropGetInit { get; init; } | ||
public required string PropRequiredGetSet { get; set; } | ||
public required string PropRequiredGetInit { get; init; } | ||
protected int ProtectedPropGetSet { get; set; } | ||
internal int InternalPropGetSet { get; set; } | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
NTypewriter.CodeModel.Tests/Property/GetMethod_IsPublic/inputTemplate.tsnt
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,8 @@ | ||
{{- capture captured}} | ||
{{- for class in data.Classes | Symbols.WhereNamespaceStartsWith "NTypewriter.Tests.CodeModel"}} | ||
{{- for property in class.Properties }} | ||
{{- property.Name | String.PadRight 21 }}{{ (property.GetMethod?.IsPublic )}} | ||
{{ end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- Save captured "Some name" }} |
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
10 changes: 10 additions & 0 deletions
10
NTypewriter.CodeModel.Tests/Property/SetMethod_IsPublic/expectedResult.txt
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,10 @@ | ||
PropGetSet true | ||
PropGet | ||
PropGetInternalSet false | ||
PropGetPrivateSet false | ||
PropGetProtectedSet false | ||
PropGetInit true | ||
PropRequiredGetSet false | ||
PropRequiredGetInit false | ||
ProtectedPropGetSet false | ||
InternalPropGetSet false |
25 changes: 25 additions & 0 deletions
25
NTypewriter.CodeModel.Tests/Property/SetMethod_IsPublic/inputCode.cs
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,25 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace NTypewriter.Tests.CodeModel | ||
{ | ||
|
||
|
||
|
||
class SampleClass | ||
{ | ||
public int PropGetSet { get; set; } | ||
public int PropGet { get; } | ||
public int PropGetInternalSet { get; internal set; } | ||
public int PropGetPrivateSet { get; private set; } | ||
public int PropGetProtectedSet { get; protected set; } | ||
public int PropGetInit { get; init; } | ||
public required string PropRequiredGetSet { get; set; } | ||
public required string PropRequiredGetInit { get; init; } | ||
protected int ProtectedPropGetSet { get; set; } | ||
internal int InternalPropGetSet { get; set; } | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
NTypewriter.CodeModel.Tests/Property/SetMethod_IsPublic/inputTemplate.tsnt
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,8 @@ | ||
{{- capture captured}} | ||
{{- for class in data.Classes | Symbols.WhereNamespaceStartsWith "NTypewriter.Tests.CodeModel"}} | ||
{{- for property in class.Properties }} | ||
{{- property.Name | String.PadRight 21 }}{{ (property.SetMethod?.IsPublic )}} | ||
{{ end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- Save captured "Some name" }} |
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