tests/functions/Set-D365FavoriteBookmark.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
Describe "Set-D365FavoriteBookmark 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 Set-D365FavoriteBookmark).ParameterSets.Name | Should -Be 'D365FO', 'AzureDevOps'
        }
        
        It 'Should have the expected parameter URL' {
            $parameter = (Get-Command Set-D365FavoriteBookmark).Parameters['URL']
            $parameter.Name | Should -Be 'URL'
            $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 $True
            $parameter.ParameterSets['__AllParameterSets'].ValueFromRemainingArguments | Should -Be $False
        }
        It 'Should have the expected parameter D365FO' {
            $parameter = (Get-Command Set-D365FavoriteBookmark).Parameters['D365FO']
            $parameter.Name | Should -Be 'D365FO'
            $parameter.ParameterType.ToString() | Should -Be System.Management.Automation.SwitchParameter
            $parameter.IsDynamic | Should -Be $False
            $parameter.ParameterSets.Keys | Should -Be 'D365FO'
            $parameter.ParameterSets.Keys | Should -Contain 'D365FO'
            $parameter.ParameterSets['D365FO'].IsMandatory | Should -Be $False
            $parameter.ParameterSets['D365FO'].Position | Should -Be -2147483648
            $parameter.ParameterSets['D365FO'].ValueFromPipeline | Should -Be $False
            $parameter.ParameterSets['D365FO'].ValueFromPipelineByPropertyName | Should -Be $False
            $parameter.ParameterSets['D365FO'].ValueFromRemainingArguments | Should -Be $False
        }
        It 'Should have the expected parameter AzureDevOps' {
            $parameter = (Get-Command Set-D365FavoriteBookmark).Parameters['AzureDevOps']
            $parameter.Name | Should -Be 'AzureDevOps'
            $parameter.ParameterType.ToString() | Should -Be System.Management.Automation.SwitchParameter
            $parameter.IsDynamic | Should -Be $False
            $parameter.ParameterSets.Keys | Should -Be 'AzureDevOps'
            $parameter.ParameterSets.Keys | Should -Contain 'AzureDevOps'
            $parameter.ParameterSets['AzureDevOps'].IsMandatory | Should -Be $False
            $parameter.ParameterSets['AzureDevOps'].Position | Should -Be -2147483648
            $parameter.ParameterSets['AzureDevOps'].ValueFromPipeline | Should -Be $False
            $parameter.ParameterSets['AzureDevOps'].ValueFromPipelineByPropertyName | Should -Be $False
            $parameter.ParameterSets['AzureDevOps'].ValueFromRemainingArguments | Should -Be $False
        }
    }
    
    Describe "Testing parameterset D365FO" {
        <#
        D365FO -
        D365FO -URL -D365FO
        #>

    }
     Describe "Testing parameterset AzureDevOps" {
        <#
        AzureDevOps -
        AzureDevOps -URL -AzureDevOps
        #>

    }

}