Skip to content

Commit

Permalink
Style fixes to xWebsite tests
Browse files Browse the repository at this point in the history
  • Loading branch information
remcoeissing committed Nov 15, 2016
1 parent 9271248 commit e08772c
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions Tests/Unit/MSFT_xWebsite.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -494,31 +494,31 @@ try
}

Context 'Check AutoStartProvider is different' {
Mock -CommandName Get-Website -MockWith {return $MockWebsite}
Mock -CommandName Get-Website -MockWith { return $MockWebsite }

$Result = Test-TargetResource -Ensure $MockParameters.Ensure `
$result = Test-TargetResource -Ensure $MockParameters.Ensure `
-Name $MockParameters.Name `
-PhysicalPath $MockParameters.PhysicalPath `
-ServiceAutoStartProvider 'MockAutoStartProviderDifferent' `
-ApplicationType 'MockApplicationTypeDifferent' `
-Verbose:$VerbosePreference

It 'should return False' {
$Result | Should Be $false
It 'Should return False' {
$result | Should Be $false
}
}

Context 'Check LogPath is equal' {
$MockLogOutput.directory = $MockParameters.LogPath

Mock -CommandName Test-Path -MockWith {Return $true}
Mock -CommandName Test-Path -MockWith { return $true }

Mock -CommandName Get-Website -MockWith {return $MockWebsite}
Mock -CommandName Get-Website -MockWith { return $MockWebsite }

Mock -CommandName Get-WebConfigurationProperty `
-MockWith {return $MockLogOutput.logExtFileFlags }
-MockWith { return $MockLogOutput.logExtFileFlags }

$Result = Test-TargetResource -Ensure $MockParameters.Ensure `
$result = Test-TargetResource -Ensure $MockParameters.Ensure `
-Name $MockParameters.Name `
-PhysicalPath $MockParameters.PhysicalPath `
-LogPath $MockParameters.LogPath `
Expand All @@ -532,14 +532,14 @@ try
Context 'Check LogPath is different' {
$MockLogOutput.directory = $MockParameters.LogPath

Mock -CommandName Test-Path -MockWith {Return $true}
Mock -CommandName Test-Path -MockWith { return $true }

Mock -CommandName Get-Website -MockWith {return $MockWebsite}
Mock -CommandName Get-Website -MockWith { return $MockWebsite }

Mock -CommandName Get-WebConfigurationProperty `
-MockWith {return $MockLogOutput.logExtFileFlags }
-MockWith { return $MockLogOutput.logExtFileFlags }

$Result = Test-TargetResource -Ensure $MockParameters.Ensure `
$result = Test-TargetResource -Ensure $MockParameters.Ensure `
-Name $MockParameters.Name `
-PhysicalPath $MockParameters.PhysicalPath `
-LogPath 'C:\MockLogPath2' `
Expand All @@ -560,14 +560,14 @@ try
localTimeRollover = $MockParameters.LoglocalTimeRollover
}

Mock -CommandName Test-Path -MockWith {Return $true}
Mock -CommandName Test-Path -MockWith { return $true }

Mock -CommandName Get-Website -MockWith {return $MockWebsite}
Mock -CommandName Get-Website -MockWith { return $MockWebsite }

Mock -CommandName Get-WebConfigurationProperty `
-MockWith {return $MockLogOutput.logExtFileFlags }
-MockWith { return $MockLogOutput.logExtFileFlags }

$Result = Test-TargetResource -Ensure $MockParameters.Ensure `
$result = Test-TargetResource -Ensure $MockParameters.Ensure `
-Name $MockParameters.Name `
-PhysicalPath $MockParameters.PhysicalPath `
-LogFlags 'Date','Time','ClientIP','UserName','ServerIP' `
Expand Down Expand Up @@ -1030,7 +1030,7 @@ try
}
}

Mock -CommandName Get-Website -MockWith {return $MockWebsite}
Mock -CommandName Get-Website -MockWith { return $MockWebsite }

Mock -CommandName Get-Command -MockWith {
return @{
Expand Down Expand Up @@ -1066,9 +1066,9 @@ try
Mock -CommandName Test-AuthenticationEnabled { return $false } `
-ParameterFilter { ($Type -eq 'Windows') }

$Result = Set-TargetResource @MockParameters
$result = Set-TargetResource @MockParameters

It 'should call all the mocks' {
It 'Should call all the mocks' {
Assert-MockCalled -CommandName Test-WebsiteBinding -Exactly 1
Assert-MockCalled -CommandName Update-WebsiteBinding -Exactly 1
Assert-MockCalled -CommandName Set-ItemProperty -Exactly 8
Expand Down Expand Up @@ -1100,7 +1100,7 @@ try
}
}

Mock -CommandName Get-Website -MockWith {return $MockWebsite}
Mock -CommandName Get-Website -MockWith { return $MockWebsite }

Mock -CommandName Get-Command -MockWith {
return @{
Expand Down Expand Up @@ -1136,9 +1136,9 @@ try
Mock -CommandName Test-AuthenticationEnabled { return $false } `
-ParameterFilter { ($Type -eq 'Windows') }

$Result = Set-TargetResource @MockParameters
$result = Set-TargetResource @MockParameters

It 'should call all the mocks' {
It 'Should call all the mocks' {
Assert-MockCalled -CommandName Test-WebsiteBinding -Exactly 1
Assert-MockCalled -CommandName Update-WebsiteBinding -Exactly 1
Assert-MockCalled -CommandName Set-ItemProperty -Exactly 9
Expand Down

0 comments on commit e08772c

Please sign in to comment.