tests/functions/Install-UdeModel.Tests.ps1
|
Describe "Install-UdeModel Unit Tests" -Tag "Unit" { BeforeAll { # Place here all things needed to prepare for the tests } AfterAll { # Here is where all the cleanup tasks go } Describe "Ensuring unchanged command signature" { It "should have the expected parameter sets" { (Get-Command Install-UdeModel).ParameterSets.Name | Should -Be 'Install', 'Export' } It 'Should have the expected parameter Path' { $parameter = (Get-Command Install-UdeModel).Parameters['Path'] $parameter.Name | Should -Be 'Path' $parameter.ParameterType.ToString() | Should -Be System.String $parameter.IsDynamic | Should -Be $False $parameter.ParameterSets.Keys | Should -Be 'Export', 'Install' $parameter.ParameterSets.Keys | Should -Contain 'Export' $parameter.ParameterSets['Export'].IsMandatory | Should -Be $True $parameter.ParameterSets['Export'].Position | Should -Be -2147483648 $parameter.ParameterSets['Export'].ValueFromPipeline | Should -Be $False $parameter.ParameterSets['Export'].ValueFromPipelineByPropertyName | Should -Be $False $parameter.ParameterSets['Export'].ValueFromRemainingArguments | Should -Be $False $parameter.ParameterSets.Keys | Should -Contain 'Install' $parameter.ParameterSets['Install'].IsMandatory | Should -Be $True $parameter.ParameterSets['Install'].Position | Should -Be -2147483648 $parameter.ParameterSets['Install'].ValueFromPipeline | Should -Be $False $parameter.ParameterSets['Install'].ValueFromPipelineByPropertyName | Should -Be $False $parameter.ParameterSets['Install'].ValueFromRemainingArguments | Should -Be $False } It 'Should have the expected parameter Force' { $parameter = (Get-Command Install-UdeModel).Parameters['Force'] $parameter.Name | Should -Be 'Force' $parameter.ParameterType.ToString() | Should -Be System.Management.Automation.SwitchParameter $parameter.IsDynamic | Should -Be $False $parameter.ParameterSets.Keys | Should -Be 'Install' $parameter.ParameterSets.Keys | Should -Contain 'Install' $parameter.ParameterSets['Install'].IsMandatory | Should -Be $False $parameter.ParameterSets['Install'].Position | Should -Be -2147483648 $parameter.ParameterSets['Install'].ValueFromPipeline | Should -Be $False $parameter.ParameterSets['Install'].ValueFromPipelineByPropertyName | Should -Be $False $parameter.ParameterSets['Install'].ValueFromRemainingArguments | Should -Be $False } It 'Should have the expected parameter AsExcelOutput' { $parameter = (Get-Command Install-UdeModel).Parameters['AsExcelOutput'] $parameter.Name | Should -Be 'AsExcelOutput' $parameter.ParameterType.ToString() | Should -Be System.Management.Automation.SwitchParameter $parameter.IsDynamic | Should -Be $False $parameter.ParameterSets.Keys | Should -Be 'Export', 'Install' $parameter.ParameterSets.Keys | Should -Contain 'Export' $parameter.ParameterSets['Export'].IsMandatory | Should -Be $False $parameter.ParameterSets['Export'].Position | Should -Be -2147483648 $parameter.ParameterSets['Export'].ValueFromPipeline | Should -Be $False $parameter.ParameterSets['Export'].ValueFromPipelineByPropertyName | Should -Be $False $parameter.ParameterSets['Export'].ValueFromRemainingArguments | Should -Be $False $parameter.ParameterSets.Keys | Should -Contain 'Install' $parameter.ParameterSets['Install'].IsMandatory | Should -Be $False $parameter.ParameterSets['Install'].Position | Should -Be -2147483648 $parameter.ParameterSets['Install'].ValueFromPipeline | Should -Be $False $parameter.ParameterSets['Install'].ValueFromPipelineByPropertyName | Should -Be $False $parameter.ParameterSets['Install'].ValueFromRemainingArguments | Should -Be $False } It 'Should have the expected parameter OutputPath' { $parameter = (Get-Command Install-UdeModel).Parameters['OutputPath'] $parameter.Name | Should -Be 'OutputPath' $parameter.ParameterType.ToString() | Should -Be System.String $parameter.IsDynamic | Should -Be $False $parameter.ParameterSets.Keys | Should -Be 'Export' $parameter.ParameterSets.Keys | Should -Contain 'Export' $parameter.ParameterSets['Export'].IsMandatory | Should -Be $True $parameter.ParameterSets['Export'].Position | Should -Be -2147483648 $parameter.ParameterSets['Export'].ValueFromPipeline | Should -Be $False $parameter.ParameterSets['Export'].ValueFromPipelineByPropertyName | Should -Be $False $parameter.ParameterSets['Export'].ValueFromRemainingArguments | Should -Be $False } It 'Should have the expected parameter ExportOnly' { $parameter = (Get-Command Install-UdeModel).Parameters['ExportOnly'] $parameter.Name | Should -Be 'ExportOnly' $parameter.ParameterType.ToString() | Should -Be System.Management.Automation.SwitchParameter $parameter.IsDynamic | Should -Be $False $parameter.ParameterSets.Keys | Should -Be 'Export' $parameter.ParameterSets.Keys | Should -Contain 'Export' $parameter.ParameterSets['Export'].IsMandatory | Should -Be $True $parameter.ParameterSets['Export'].Position | Should -Be -2147483648 $parameter.ParameterSets['Export'].ValueFromPipeline | Should -Be $False $parameter.ParameterSets['Export'].ValueFromPipelineByPropertyName | Should -Be $False $parameter.ParameterSets['Export'].ValueFromRemainingArguments | Should -Be $False } } Describe "Testing parameterset Install" { <# Install -Path Install -Path -Force -AsExcelOutput #> } Describe "Testing parameterset Export" { <# Export -Path -OutputPath -ExportOnly Export -Path -AsExcelOutput -OutputPath -ExportOnly #> } } |