tests/functions/Get-D365LabelOld.Tests.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
Describe "Get-D365LabelOld 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 Get-D365LabelOld).ParameterSets.Name | Should -Be 'Default', 'Specific'
        }
        
        It 'Should have the expected parameter FilePath' {
            $parameter = (Get-Command Get-D365LabelOld).Parameters['FilePath']
            $parameter.Name | Should -Be 'FilePath'
            $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 $True
            $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 $True
            $parameter.ParameterSets['Default'].Position | Should -Be 1
            $parameter.ParameterSets['Default'].ValueFromPipeline | Should -Be $False
            $parameter.ParameterSets['Default'].ValueFromPipelineByPropertyName | Should -Be $True
            $parameter.ParameterSets['Default'].ValueFromRemainingArguments | Should -Be $False
        }
        It 'Should have the expected parameter Name' {
            $parameter = (Get-Command Get-D365LabelOld).Parameters['Name']
            $parameter.Name | Should -Be 'Name'
            $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 2
            $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 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 Value' {
            $parameter = (Get-Command Get-D365LabelOld).Parameters['Value']
            $parameter.Name | Should -Be 'Value'
            $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 2
            $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 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 IncludePath' {
            $parameter = (Get-Command Get-D365LabelOld).Parameters['IncludePath']
            $parameter.Name | Should -Be 'IncludePath'
            $parameter.ParameterType.ToString() | Should -Be System.Management.Automation.SwitchParameter
            $parameter.IsDynamic | Should -Be $False
            $parameter.ParameterSets.Keys | Should -Be '__AllParameterSets'
            $parameter.ParameterSets.Keys | Should -Contain '__AllParameterSets'
            $parameter.ParameterSets['__AllParameterSets'].IsMandatory | Should -Be $False
            $parameter.ParameterSets['__AllParameterSets'].Position | Should -Be -2147483648
            $parameter.ParameterSets['__AllParameterSets'].ValueFromPipeline | Should -Be $False
            $parameter.ParameterSets['__AllParameterSets'].ValueFromPipelineByPropertyName | Should -Be $False
            $parameter.ParameterSets['__AllParameterSets'].ValueFromRemainingArguments | Should -Be $False
        }
    }
    
    Describe "Testing parameterset Default" {
        <#
        Default -FilePath
        Default -FilePath -Name -Value -IncludePath
        #>

    }
     Describe "Testing parameterset Specific" {
        <#
        Specific -FilePath
        Specific -FilePath -Name -Value -IncludePath
        #>

    }

}