tests/functions/Initialize-AXModelStoreV2.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
Describe "Initialize-AXModelStoreV2 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 Initialize-AXModelStoreV2).ParameterSets.Name | Should -Be 'CreateSchema', 'Drop', 'CreateDB'
        }
        
        It 'Should have the expected parameter DatabaseServer' {
            $parameter = (Get-Command Initialize-AXModelStoreV2).Parameters['DatabaseServer']
            $parameter.Name | Should -Be 'DatabaseServer'
            $parameter.ParameterType.ToString() | Should -Be System.String
            $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
        }
        It 'Should have the expected parameter ModelstoreDatabase' {
            $parameter = (Get-Command Initialize-AXModelStoreV2).Parameters['ModelstoreDatabase']
            $parameter.Name | Should -Be 'ModelstoreDatabase'
            $parameter.ParameterType.ToString() | Should -Be System.String
            $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
        }
        It 'Should have the expected parameter SchemaName' {
            $parameter = (Get-Command Initialize-AXModelStoreV2).Parameters['SchemaName']
            $parameter.Name | Should -Be 'SchemaName'
            $parameter.ParameterType.ToString() | Should -Be System.String
            $parameter.IsDynamic | Should -Be $False
            $parameter.ParameterSets.Keys | Should -Be 'CreateSchema', 'Drop'
            $parameter.ParameterSets.Keys | Should -Contain 'CreateSchema'
            $parameter.ParameterSets['CreateSchema'].IsMandatory | Should -Be $False
            $parameter.ParameterSets['CreateSchema'].Position | Should -Be -2147483648
            $parameter.ParameterSets['CreateSchema'].ValueFromPipeline | Should -Be $False
            $parameter.ParameterSets['CreateSchema'].ValueFromPipelineByPropertyName | Should -Be $False
            $parameter.ParameterSets['CreateSchema'].ValueFromRemainingArguments | Should -Be $False
            $parameter.ParameterSets.Keys | Should -Contain 'Drop'
            $parameter.ParameterSets['Drop'].IsMandatory | Should -Be $False
            $parameter.ParameterSets['Drop'].Position | Should -Be -2147483648
            $parameter.ParameterSets['Drop'].ValueFromPipeline | Should -Be $False
            $parameter.ParameterSets['Drop'].ValueFromPipelineByPropertyName | Should -Be $False
            $parameter.ParameterSets['Drop'].ValueFromRemainingArguments | Should -Be $False
        }
        It 'Should have the expected parameter DropSchema' {
            $parameter = (Get-Command Initialize-AXModelStoreV2).Parameters['DropSchema']
            $parameter.Name | Should -Be 'DropSchema'
            $parameter.ParameterType.ToString() | Should -Be System.Management.Automation.SwitchParameter
            $parameter.IsDynamic | Should -Be $False
            $parameter.ParameterSets.Keys | Should -Be 'Drop'
            $parameter.ParameterSets.Keys | Should -Contain 'Drop'
            $parameter.ParameterSets['Drop'].IsMandatory | Should -Be $False
            $parameter.ParameterSets['Drop'].Position | Should -Be -2147483648
            $parameter.ParameterSets['Drop'].ValueFromPipeline | Should -Be $False
            $parameter.ParameterSets['Drop'].ValueFromPipelineByPropertyName | Should -Be $False
            $parameter.ParameterSets['Drop'].ValueFromRemainingArguments | Should -Be $False
        }
        It 'Should have the expected parameter CreateSchema' {
            $parameter = (Get-Command Initialize-AXModelStoreV2).Parameters['CreateSchema']
            $parameter.Name | Should -Be 'CreateSchema'
            $parameter.ParameterType.ToString() | Should -Be System.Management.Automation.SwitchParameter
            $parameter.IsDynamic | Should -Be $False
            $parameter.ParameterSets.Keys | Should -Be 'CreateSchema'
            $parameter.ParameterSets.Keys | Should -Contain 'CreateSchema'
            $parameter.ParameterSets['CreateSchema'].IsMandatory | Should -Be $False
            $parameter.ParameterSets['CreateSchema'].Position | Should -Be -2147483648
            $parameter.ParameterSets['CreateSchema'].ValueFromPipeline | Should -Be $False
            $parameter.ParameterSets['CreateSchema'].ValueFromPipelineByPropertyName | Should -Be $False
            $parameter.ParameterSets['CreateSchema'].ValueFromRemainingArguments | Should -Be $False
        }
        It 'Should have the expected parameter CreateDb' {
            $parameter = (Get-Command Initialize-AXModelStoreV2).Parameters['CreateDb']
            $parameter.Name | Should -Be 'CreateDb'
            $parameter.ParameterType.ToString() | Should -Be System.Management.Automation.SwitchParameter
            $parameter.IsDynamic | Should -Be $False
            $parameter.ParameterSets.Keys | Should -Be 'CreateDB'
            $parameter.ParameterSets.Keys | Should -Contain 'CreateDB'
            $parameter.ParameterSets['CreateDB'].IsMandatory | Should -Be $False
            $parameter.ParameterSets['CreateDB'].Position | Should -Be -2147483648
            $parameter.ParameterSets['CreateDB'].ValueFromPipeline | Should -Be $False
            $parameter.ParameterSets['CreateDB'].ValueFromPipelineByPropertyName | Should -Be $False
            $parameter.ParameterSets['CreateDB'].ValueFromRemainingArguments | Should -Be $False
        }
        It 'Should have the expected parameter GenerateScript' {
            $parameter = (Get-Command Initialize-AXModelStoreV2).Parameters['GenerateScript']
            $parameter.Name | Should -Be 'GenerateScript'
            $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 CreateSchema" {
        <#
        CreateSchema -
        CreateSchema -DatabaseServer -ModelstoreDatabase -SchemaName -CreateSchema -GenerateScript
        #>

    }
     Describe "Testing parameterset Drop" {
        <#
        Drop -
        Drop -DatabaseServer -ModelstoreDatabase -SchemaName -DropSchema -GenerateScript
        #>

    }
     Describe "Testing parameterset CreateDB" {
        <#
        CreateDB -
        CreateDB -DatabaseServer -ModelstoreDatabase -CreateDb -GenerateScript
        #>

    }

}