Skip to content

Commit

Permalink
Fix style formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
johlju committed Jul 28, 2022
1 parent 53777b9 commit 2613ab7
Show file tree
Hide file tree
Showing 10 changed files with 276 additions and 276 deletions.
18 changes: 9 additions & 9 deletions source/Classes/020.SqlDatabasePermission.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class SqlDatabasePermission : ResourceBase
if (-not $this.sqlServerObject)
{
$connectSqlDscDatabaseEngineParameters = @{
ServerName = $this.ServerName
ServerName = $this.ServerName
InstanceName = $this.InstanceName
}

Expand Down Expand Up @@ -497,7 +497,7 @@ class SqlDatabasePermission : ResourceBase
else
{
[DatabasePermission[]] $permissionsToRevoke += [DatabasePermission] @{
State = $currentPermissionsForState.State
State = $currentPermissionsForState.State
Permission = $permissionName
}
}
Expand Down Expand Up @@ -624,7 +624,7 @@ class SqlDatabasePermission : ResourceBase
{
# PermissionToInclude and PermissionToExclude should be mutually exclusive from Permission
$assertBoundParameterParameters = @{
BoundParameterList = $properties
BoundParameterList = $properties
MutuallyExclusiveList1 = @(
'Permission'
)
Expand All @@ -638,12 +638,12 @@ class SqlDatabasePermission : ResourceBase

# Get all assigned permission properties.
$assignedPermissionProperty = $properties.Keys.Where({
$_ -in @(
'Permission',
'PermissionToInclude',
'PermissionToExclude'
)
})
$_ -in @(
'Permission',
'PermissionToInclude',
'PermissionToExclude'
)
})

# Must include either of the permission properties.
if ([System.String]::IsNullOrEmpty($assignedPermissionProperty))
Expand Down
2 changes: 1 addition & 1 deletion source/Private/ConvertTo-Reason.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function ConvertTo-Reason
}

$reasons += [Reason] @{
Code = '{0}:{0}:{1}' -f $ResourceName, $currentProperty.Property
Code = '{0}:{0}:{1}' -f $ResourceName, $currentProperty.Property
# Convert the object to JSON to handle complex types.
Phrase = 'The property {0} should be {1}, but was {2}' -f $currentProperty.Property, ($propertyExpectedValue | ConvertTo-Json -Compress), ($propertyActualValue | ConvertTo-Json -Compress)
}
Expand Down
6 changes: 3 additions & 3 deletions source/Public/ConvertTo-SqlDscDatabasePermission.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ function ConvertTo-SqlDscDatabasePermission
}

$databasePermissionStateExist = $permissions.Where({
$_.State -contains $currentPermissionState
}) |
$_.State -contains $currentPermissionState
}) |
Select-Object -First 1

if ($databasePermissionStateExist)
Expand All @@ -62,7 +62,7 @@ function ConvertTo-SqlDscDatabasePermission
else
{
$databasePermission = [DatabasePermission] @{
State = $currentPermissionState
State = $currentPermissionState
Permission = [System.String[]] @()
}
}
Expand Down
36 changes: 18 additions & 18 deletions tests/Unit/Classes/DatabasePermission.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ Describe 'DatabasePermission' -Tag 'DatabasePermission' {
It 'Should return a value less than zero' {
$mockDatabasePermissionInstance1 = InModuleScope -ScriptBlock {
[DatabasePermission] @{
State = 'Grant'
State = 'Grant'
Permission = 'Select'
}
}
Expand Down Expand Up @@ -199,28 +199,28 @@ Describe 'DatabasePermission' -Tag 'DatabasePermission' {
Context 'When the instance has the state ''<MockInstanceState>'' and object has state ''<MockObjectState>''' -ForEach @(
@{
MockInstanceState = 'Grant'
MockObjectState = 'GrantWithGrant'
MockObjectState = 'GrantWithGrant'
}
@{
MockInstanceState = 'Grant'
MockObjectState = 'Deny'
MockObjectState = 'Deny'
}
@{
MockInstanceState = 'GrantWithGrant'
MockObjectState = 'Deny'
MockObjectState = 'Deny'
}
) {
It 'Should return a value less than zero' {
$mockDatabasePermissionInstance1 = InModuleScope -Parameters $_ -ScriptBlock {
[DatabasePermission] @{
State = $MockInstanceState
State = $MockInstanceState
Permission = 'Select'
}
}

$mockDatabasePermissionInstance2 = InModuleScope -Parameters $_ -ScriptBlock {
[DatabasePermission] @{
State = $MockObjectState
State = $MockObjectState
Permission = 'Select'
}
}
Expand All @@ -234,28 +234,28 @@ Describe 'DatabasePermission' -Tag 'DatabasePermission' {
Context 'When the instance has the state ''<MockInstanceState>'' and object has state ''<MockObjectState>''' -ForEach @(
@{
MockInstanceState = 'Deny'
MockObjectState = 'Grant'
MockObjectState = 'Grant'
}
@{
MockInstanceState = 'GrantWithGrant'
MockObjectState = 'Grant'
MockObjectState = 'Grant'
}
@{
MockInstanceState = 'Deny'
MockObjectState = 'GrantWithGrant'
MockObjectState = 'GrantWithGrant'
}
) {
It 'Should return a value less than zero' {
$mockDatabasePermissionInstance1 = InModuleScope -Parameters $_ -ScriptBlock {
[DatabasePermission] @{
State = $MockInstanceState
State = $MockInstanceState
Permission = 'Select'
}
}

$mockDatabasePermissionInstance2 = InModuleScope -Parameters $_ -ScriptBlock {
[DatabasePermission] @{
State = $MockObjectState
State = $MockObjectState
Permission = 'Select'
}
}
Expand All @@ -268,7 +268,7 @@ Describe 'DatabasePermission' -Tag 'DatabasePermission' {
It 'Should return a value less than zero' {
$mockDatabasePermissionInstance1 = InModuleScope -ScriptBlock {
[DatabasePermission] @{
State = 'Grant'
State = 'Grant'
Permission = 'Select'
}
}
Expand All @@ -282,28 +282,28 @@ Describe 'DatabasePermission' -Tag 'DatabasePermission' {
Context 'When the instance has the state ''<MockInstanceState>'' and object has state ''<MockObjectState>''' -ForEach @(
@{
MockInstanceState = 'Grant'
MockObjectState = 'Grant'
MockObjectState = 'Grant'
}
@{
MockInstanceState = 'GrantWithGrant'
MockObjectState = 'GrantWithGrant'
MockObjectState = 'GrantWithGrant'
}
@{
MockInstanceState = 'Deny'
MockObjectState = 'Deny'
MockObjectState = 'Deny'
}
) {
It 'Should return a value less than zero' {
$mockDatabasePermissionInstance1 = InModuleScope -Parameters $_ -ScriptBlock {
[DatabasePermission] @{
State = $MockInstanceState
State = $MockInstanceState
Permission = 'Select'
}
}

$mockDatabasePermissionInstance2 = InModuleScope -Parameters $_ -ScriptBlock {
[DatabasePermission] @{
State = $MockObjectState
State = $MockObjectState
Permission = 'Select'
}
}
Expand Down Expand Up @@ -339,7 +339,7 @@ Describe 'DatabasePermission' -Tag 'DatabasePermission' {
foreach ($currentMockState in $MockState)
{
[DatabasePermission] @{
State = $currentMockState
State = $currentMockState
Permission = 'Select'
}
}
Expand Down
Loading

0 comments on commit 2613ab7

Please sign in to comment.