diff --git a/tests/Measure-DbaDiskSpaceRequirement.Tests.ps1 b/tests/Measure-DbaDiskSpaceRequirement.Tests.ps1 index a3d2267831..dee6860a71 100644 --- a/tests/Measure-DbaDiskSpaceRequirement.Tests.ps1 +++ b/tests/Measure-DbaDiskSpaceRequirement.Tests.ps1 @@ -4,11 +4,11 @@ $global:TestConfig = Get-TestConfig Describe "$CommandName Unit Tests" -Tag 'UnitTests' { Context "Validate parameters" { - [object[]]$params = (Get-Command $CommandName).Parameters.Keys | Where-Object {$_ -notin ('whatif', 'confirm')} + [object[]]$params = (Get-Command $CommandName).Parameters.Keys | Where-Object { $_ -notin ('whatif', 'confirm') } [object[]]$knownParameters = 'Source', 'Database', 'SourceSqlCredential', 'Destination', 'DestinationDatabase', 'DestinationSqlCredential', 'Credential', 'EnableException' $knownParameters += [System.Management.Automation.PSCmdlet]::CommonParameters It "Should only contain our specific parameters" { - (@(Compare-Object -ReferenceObject ($knownParameters | Where-Object {$_}) -DifferenceObject $params).Count ) | Should Be 0 + (@(Compare-Object -ReferenceObject ($knownParameters | Where-Object { $_ }) -DifferenceObject $params).Count ) | Should Be 0 } } } @@ -31,18 +31,18 @@ Describe "$commandname Integration Tests" -Tags "IntegrationTests" { It "Should be sourced from Master" { $r.SourceDatabase | Should -Be $Options.Database } - It "Should be sourced from the instance $($TestConfig.instance1)" { - $r.SourceSqlInstance | Should -Be $server1.SqlInstance + It "Should be sourced from the correct instance" { + $r.SourceSqlInstance.InstanceName | Should -Be $server1.InstanceName } It "Should be destined for Dbatoolsci_DestinationDB" { $r.DestinationDatabase | Should -Be $Options.DestinationDatabase } - It "Should be destined for the instance $($TestConfig.instance2)" { - $r.DestinationSqlInstance | Should -Be $server2.SqlInstance + It "Should be destined for the correct instance" { + $r.DestinationSqlInstance.InstanceName | Should -Be $server2.InstanceName } - It "Should be have files on source" { + It "Should have files on source" { $r.FileLocation | Should Be "Only on Source" } } } -} +} \ No newline at end of file