tests/functions/Start-D365Environment.Tests.ps1

Describe "Start-D365Environment 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 Start-D365Environment).ParameterSets.Name | Should -Be 'Default', 'Specific'
        }
        
        It 'Should have the expected parameter ComputerName' {
            $parameter = (Get-Command Start-D365Environment).Parameters['ComputerName']
            $parameter.Name | Should -Be 'ComputerName'
            $parameter.ParameterType.ToString() | Should -Be System.String[]
            $parameter.IsDynamic | Should -Be $False
            $parameter.ParameterSets.Keys | Should -Be 'Specific', 'Default'
            $parameter.ParameterSets.Keys | Should -Contain 'Specific'
            $parameter.ParameterSets['Specific'].IsMandatory | Should -Be $False
            $parameter.ParameterSets['Specific'].Position | Should -Be 1
            $parameter.ParameterSets['Specific'].ValueFromPipeline | Should -Be $False
            $parameter.ParameterSets['Specific'].ValueFromPipelineByPropertyName | Should -Be $False
            $parameter.ParameterSets['Specific'].ValueFromRemainingArguments | Should -Be $False
            $parameter.ParameterSets.Keys | Should -Contain 'Default'
            $parameter.ParameterSets['Default'].IsMandatory | Should -Be $False
            $parameter.ParameterSets['Default'].Position | Should -Be 1
            $parameter.ParameterSets['Default'].ValueFromPipeline | Should -Be $False
            $parameter.ParameterSets['Default'].ValueFromPipelineByPropertyName | Should -Be $False
            $parameter.ParameterSets['Default'].ValueFromRemainingArguments | Should -Be $False
        }
        It 'Should have the expected parameter All' {
            $parameter = (Get-Command Start-D365Environment).Parameters['All']
            $parameter.Name | Should -Be 'All'
            $parameter.ParameterType.ToString() | Should -Be System.Management.Automation.SwitchParameter
            $parameter.IsDynamic | Should -Be $False
            $parameter.ParameterSets.Keys | Should -Be 'Default'
            $parameter.ParameterSets.Keys | Should -Contain 'Default'
            $parameter.ParameterSets['Default'].IsMandatory | Should -Be $False
            $parameter.ParameterSets['Default'].Position | Should -Be 2
            $parameter.ParameterSets['Default'].ValueFromPipeline | Should -Be $False
            $parameter.ParameterSets['Default'].ValueFromPipelineByPropertyName | Should -Be $False
            $parameter.ParameterSets['Default'].ValueFromRemainingArguments | Should -Be $False
        }
        It 'Should have the expected parameter Aos' {
            $parameter = (Get-Command Start-D365Environment).Parameters['Aos']
            $parameter.Name | Should -Be 'Aos'
            $parameter.ParameterType.ToString() | Should -Be System.Management.Automation.SwitchParameter
            $parameter.IsDynamic | Should -Be $False
            $parameter.ParameterSets.Keys | Should -Be 'Specific'
            $parameter.ParameterSets.Keys | Should -Contain 'Specific'
            $parameter.ParameterSets['Specific'].IsMandatory | Should -Be $False
            $parameter.ParameterSets['Specific'].Position | Should -Be 2
            $parameter.ParameterSets['Specific'].ValueFromPipeline | Should -Be $False
            $parameter.ParameterSets['Specific'].ValueFromPipelineByPropertyName | Should -Be $False
            $parameter.ParameterSets['Specific'].ValueFromRemainingArguments | Should -Be $False
        }
        It 'Should have the expected parameter Batch' {
            $parameter = (Get-Command Start-D365Environment).Parameters['Batch']
            $parameter.Name | Should -Be 'Batch'
            $parameter.ParameterType.ToString() | Should -Be System.Management.Automation.SwitchParameter
            $parameter.IsDynamic | Should -Be $False
            $parameter.ParameterSets.Keys | Should -Be 'Specific'
            $parameter.ParameterSets.Keys | Should -Contain 'Specific'
            $parameter.ParameterSets['Specific'].IsMandatory | Should -Be $False
            $parameter.ParameterSets['Specific'].Position | Should -Be 3
            $parameter.ParameterSets['Specific'].ValueFromPipeline | Should -Be $False
            $parameter.ParameterSets['Specific'].ValueFromPipelineByPropertyName | Should -Be $False
            $parameter.ParameterSets['Specific'].ValueFromRemainingArguments | Should -Be $False
        }
        It 'Should have the expected parameter FinancialReporter' {
            $parameter = (Get-Command Start-D365Environment).Parameters['FinancialReporter']
            $parameter.Name | Should -Be 'FinancialReporter'
            $parameter.ParameterType.ToString() | Should -Be System.Management.Automation.SwitchParameter
            $parameter.IsDynamic | Should -Be $False
            $parameter.ParameterSets.Keys | Should -Be 'Specific'
            $parameter.ParameterSets.Keys | Should -Contain 'Specific'
            $parameter.ParameterSets['Specific'].IsMandatory | Should -Be $False
            $parameter.ParameterSets['Specific'].Position | Should -Be 4
            $parameter.ParameterSets['Specific'].ValueFromPipeline | Should -Be $False
            $parameter.ParameterSets['Specific'].ValueFromPipelineByPropertyName | Should -Be $False
            $parameter.ParameterSets['Specific'].ValueFromRemainingArguments | Should -Be $False
        }
        It 'Should have the expected parameter DMF' {
            $parameter = (Get-Command Start-D365Environment).Parameters['DMF']
            $parameter.Name | Should -Be 'DMF'
            $parameter.ParameterType.ToString() | Should -Be System.Management.Automation.SwitchParameter
            $parameter.IsDynamic | Should -Be $False
            $parameter.ParameterSets.Keys | Should -Be 'Specific'
            $parameter.ParameterSets.Keys | Should -Contain 'Specific'
            $parameter.ParameterSets['Specific'].IsMandatory | Should -Be $False
            $parameter.ParameterSets['Specific'].Position | Should -Be 5
            $parameter.ParameterSets['Specific'].ValueFromPipeline | Should -Be $False
            $parameter.ParameterSets['Specific'].ValueFromPipelineByPropertyName | Should -Be $False
            $parameter.ParameterSets['Specific'].ValueFromRemainingArguments | Should -Be $False
        }
        It 'Should have the expected parameter ShowOriginalProgress' {
            $parameter = (Get-Command Start-D365Environment).Parameters['ShowOriginalProgress']
            $parameter.Name | Should -Be 'ShowOriginalProgress'
            $parameter.ParameterType.ToString() | Should -Be System.Management.Automation.SwitchParameter
            $parameter.IsDynamic | Should -Be $False
            $parameter.ParameterSets.Keys | Should -Be 'Default', 'Specific'
            $parameter.ParameterSets.Keys | Should -Contain 'Default'
            $parameter.ParameterSets['Default'].IsMandatory | Should -Be $False
            $parameter.ParameterSets['Default'].Position | Should -Be 6
            $parameter.ParameterSets['Default'].ValueFromPipeline | Should -Be $False
            $parameter.ParameterSets['Default'].ValueFromPipelineByPropertyName | Should -Be $False
            $parameter.ParameterSets['Default'].ValueFromRemainingArguments | Should -Be $False
            $parameter.ParameterSets.Keys | Should -Contain 'Specific'
            $parameter.ParameterSets['Specific'].IsMandatory | Should -Be $False
            $parameter.ParameterSets['Specific'].Position | Should -Be 6
            $parameter.ParameterSets['Specific'].ValueFromPipeline | Should -Be $False
            $parameter.ParameterSets['Specific'].ValueFromPipelineByPropertyName | Should -Be $False
            $parameter.ParameterSets['Specific'].ValueFromRemainingArguments | Should -Be $False
        }
    }
    
    Describe "Testing parameterset Default" {
        <#
        Default -
        Default -ComputerName -All -ShowOriginalProgress
        #>

    }
     Describe "Testing parameterset Specific" {
        <#
        Specific -
        Specific -ComputerName -Aos -Batch -FinancialReporter -DMF -ShowOriginalProgress
        #>

    }

}