Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
johlju committed May 9, 2020
1 parent c76d80d commit 78b5fa2
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ function Get-TargetResource
$getTargetResourceReturnValues = @{
ServerName = $ServerName
InstanceName = $InstanceName
EndpointType = $EndpointType
Ensure = 'Absent'
EndpointName = ''
Port = ''
Expand Down Expand Up @@ -206,7 +207,6 @@ function Set-TargetResource
{
if ($getTargetResourceResult.Ensure -eq 'Absent')
{

Write-Verbose -Message (
$script:localizedData.CreateEndpoint -f $EndpointName, $InstanceName
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Configuration Example
SqlServerEndpoint 'HADREndpoint'
{
EndPointName = 'HADR'
EndpointType = 'DatabaseMirroring'
Ensure = 'Present'
Port = 5022
ServerName = $Node.NodeName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Configuration Example
SqlServerEndpoint 'HADREndpoint'
{
EndPointName = 'HADR'
EndpointType = 'DatabaseMirroring'
Ensure = 'Present'
Port = 5022
ServerName = $Node.NodeName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Configuration Example
SqlServerEndpoint 'HADREndpoint'
{
EndPointName = 'HADR'
EndpointType = 'DatabaseMirroring'
Ensure = 'Present'
Port = 5022
ServerName = $Node.NodeName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Configuration Example
SqlServerEndpoint 'SQLConfigureEndpoint-Instance1'
{
EndpointName = 'HADR'
EndpointType = 'DatabaseMirroring'
InstanceName = 'INST1'

PsDscRunAsCredential = $SqlAdministratorCredential
Expand All @@ -28,6 +29,7 @@ Configuration Example
SqlServerEndpoint 'SQLConfigureEndpoint-Instances2'
{
EndpointName = 'HADR'
EndpointType = 'DatabaseMirroring'
InstanceName = 'INST2'

PsDscRunAsCredential = $SqlAdministratorCredential
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Configuration Example
Ensure = 'Absent'

EndpointName = 'HADR'
EndpointType = 'DatabaseMirroring'
InstanceName = 'INST1'

PsDscRunAsCredential = $SqlAdministratorCredential
Expand All @@ -30,6 +31,7 @@ Configuration Example
Ensure = 'Absent'

EndpointName = 'HADR'
EndpointType = 'DatabaseMirroring'
InstanceName = 'INST2'

PsDscRunAsCredential = $SqlAdministratorCredential
Expand Down
2 changes: 2 additions & 0 deletions tests/Integration/DSC_SqlServerEndpoint.Integration.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ try

$resourceCurrentState.Ensure | Should -Be 'Present'
$resourceCurrentState.EndpointName | Should -Be $ConfigurationData.AllNodes.EndpointName
$resourceCurrentState.EndpointType | Should -Be 'DatabaseMirroring'
$resourceCurrentState.Port | Should -Be $ConfigurationData.AllNodes.Port
$resourceCurrentState.IpAddress | Should -Be $ConfigurationData.AllNodes.IpAddress
$resourceCurrentState.Owner | Should -Be $ConfigurationData.AllNodes.Owner
Expand Down Expand Up @@ -124,6 +125,7 @@ try

$resourceCurrentState.Ensure | Should -Be 'Absent'
$resourceCurrentState.EndpointName | Should -BeNullOrEmpty
$resourceCurrentState.EndpointType | Should -Be 'DatabaseMirroring'
}

It 'Should return $true when Test-DscConfiguration is run' {
Expand Down
2 changes: 2 additions & 0 deletions tests/Integration/DSC_SqlServerEndpoint.config.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Configuration DSC_SqlServerEndpoint_Add_Config
Ensure = 'Present'

EndpointName = $Node.EndpointName
EndpointType = 'DatabaseMirroring'
Port = $Node.Port
IpAddress = $Node.IpAddress
Owner = $Node.Owner
Expand All @@ -72,6 +73,7 @@ Configuration DSC_SqlServerEndpoint_Remove_Config
Ensure = 'Absent'

EndpointName = $Node.EndpointName
EndpointType = 'DatabaseMirroring'

ServerName = $Node.ServerName
InstanceName = $Node.InstanceName
Expand Down

0 comments on commit 78b5fa2

Please sign in to comment.