Skip to content

Commit fb5aa9f

Browse files
committed
Rename Get-ClassResourcePropertyState2 to Get-ClassResourcePropertyType
1 parent b56de0f commit fb5aa9f

4 files changed

+17
-17
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3131
by parameter `RemoveTopLevelHeader` in the task, which defaults to `$true`.
3232
- Added Helper functions as part of [#163] (https://github.com/dsccommunity/DscResource.DocGenerator/pull/163).
3333
- `Get-ClassPropertyCustomAttribute`
34-
- `Get-ClassResourcePropertyState2`
34+
- `Get-ClassResourcePropertyType`
3535
- `Get-DscPropertyType`
3636
- `Test-ClassPropertyDscAttributeArgument`
3737

source/Private/Get-ClassResourcePropertyState2.ps1 source/Private/Get-ClassDscResourcePropertyType.ps1

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
<#
22
.SYNOPSIS
3-
This function returns the property state value of an class-based DSC
3+
This function returns the property type of a class-based DSC
44
resource property.
55
66
.DESCRIPTION
7-
This function returns the property state value of an DSC class-based
7+
This function returns the property type value of a DSC class-based
88
resource property.
99
1010
.PARAMETER PropertyInfo
11-
The PropertyInfo of a class-based DSC resource property.
11+
The PropertyInfo object of a class-based DSC resource property.
1212
1313
.EXAMPLE
14-
Get-ClassResourcePropertyState2 -PropertyInfo $properties
14+
Get-ClassResourcePropertyType -PropertyInfo $properties
1515
1616
Returns the property state for the property 'KeyName'.
1717
#>
18-
function Get-ClassResourcePropertyState2
18+
function Get-ClassResourcePropertyType
1919
{
2020
[CmdletBinding()]
2121
[OutputType([System.String])]
@@ -37,20 +37,20 @@ function Get-ClassResourcePropertyState2
3737

3838
if ((Test-ClassPropertyDscAttributeArgument -IsKey @attributeParams))
3939
{
40-
$propertyState = 'Key'
40+
$propertyType = 'Key'
4141
}
4242
elseif ((Test-ClassPropertyDscAttributeArgument -IsMandatory @attributeParams))
4343
{
44-
$propertyState = 'Required'
44+
$propertyType = 'Required'
4545
}
4646
elseif ((Test-ClassPropertyDscAttributeArgument -IsRead @attributeParams))
4747
{
48-
$propertyState = 'Read'
48+
$propertyType = 'Read'
4949
}
5050
elseif ((Test-ClassPropertyDscAttributeArgument -IsWrite @attributeParams))
5151
{
52-
$propertyState = 'Write'
52+
$propertyType = 'Write'
5353
}
5454

55-
return $propertyState
55+
return $propertyType
5656
}

source/Private/Get-ClassResourceProperty.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ function Get-ClassResourceProperty
100100
IsArray = $false
101101
}
102102

103-
$propertyAttribute.State = Get-ClassResourcePropertyState2 -PropertyInfo $propertyMember
103+
$propertyAttribute.State = Get-ClassResourcePropertyType -PropertyInfo $propertyMember
104104

105105
$valueMapValues = $null
106106
if ($propertyMember.PropertyType.IsEnum)

tests/unit/private/Get-ClassResourcePropertyState2.Tests.ps1 tests/unit/private/Get-ClassResourcePropertyType.Tests.ps1

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Import-Module $script:moduleName -Force -ErrorAction 'Stop'
1919
#endregion HEADER
2020

2121
InModuleScope $script:moduleName {
22-
Describe 'Get-ClassResourcePropertyState' {
22+
Describe 'Get-ClassResourcePropertyType' {
2323
Context 'When a property have the named attribute argument ''Key''' {
2424
BeforeAll {
2525
$mockClassBasedScript = {
@@ -51,7 +51,7 @@ InModuleScope $script:moduleName {
5151
}
5252

5353
It 'Should return the state as ''Key''' {
54-
$result = Get-ClassResourcePropertyState2 -PropertyInfo $mockProperties[0] -Verbose
54+
$result = Get-ClassResourcePropertyType -PropertyInfo $mockProperties[0] -Verbose
5555

5656
$result | Should -Be 'Key'
5757
}
@@ -92,7 +92,7 @@ InModuleScope $script:moduleName {
9292

9393
It 'Should return the state as ''Write''' {
9494
# Makes sure to test the second property (since Key is always needed)
95-
$result = Get-ClassResourcePropertyState2 -PropertyInfo $mockProperties[1] -Verbose
95+
$result = Get-ClassResourcePropertyType -PropertyInfo $mockProperties[1] -Verbose
9696

9797
$result | Should -Be 'Write'
9898
}
@@ -133,7 +133,7 @@ InModuleScope $script:moduleName {
133133

134134
It 'Should return the state as ''Required''' {
135135
# Makes sure to test the second property (since Key is always needed)
136-
$result = Get-ClassResourcePropertyState2 -PropertyInfo $mockProperties[1] -Verbose
136+
$result = Get-ClassResourcePropertyType -PropertyInfo $mockProperties[1] -Verbose
137137

138138
$result | Should -Be 'Required'
139139
}
@@ -174,7 +174,7 @@ InModuleScope $script:moduleName {
174174

175175
It 'Should return the state as ''Read''' {
176176
# Makes sure to test the second property (since Key is always needed)
177-
$result = Get-ClassResourcePropertyState2 -PropertyInfo $mockProperties[1] -Verbose
177+
$result = Get-ClassResourcePropertyType -PropertyInfo $mockProperties[1] -Verbose
178178

179179
$result | Should -Be 'Read'
180180
}

0 commit comments

Comments
 (0)