Skip to content

Commit

Permalink
Added Get-OrionApplicationCredential & tests, updated Remove-OrionNod…
Browse files Browse the repository at this point in the history
…e to fix issues with wrong SWIS connection being used.
  • Loading branch information
micheal100 committed Mar 8, 2017
1 parent 905e570 commit 55c61ee
Show file tree
Hide file tree
Showing 3 changed files with 1,021 additions and 953 deletions.
29 changes: 24 additions & 5 deletions Samples/PowerShell/PowerOrion/PowerOrion.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ InModuleScope PowerOrion{
#>}#end of inmodulescope


# describes the function Get-OrionapplicationTemplateId
Describe 'Get-OrionapplicationTemplateId' {
# describes the function Get-OrionApplicationTemplateId
Describe 'Get-OrionApplicationTemplateId' {

# scenario 1: call the function without arguments
Context 'running with arguments' {
Expand All @@ -53,14 +53,33 @@ Describe 'Get-OrionapplicationTemplateId' {
# Gotcha: to use the "Should Not Throw" assertion,
# make sure you place the command in a
# scriptblock (braces):
{ Get-OrionapplicationTemplateId -ApplicationName 'apache' -SwisConnection $swis } | Should not Throw
{ Get-OrionApplicationTemplateId -ApplicationName 'apache' -SwisConnection $swis } | Should not Throw
}
It 'returns an integer for an existing application' {
Get-OrionapplicationTemplateId -ApplicationName 'apache' -SwisConnection $swis | should be 6
Get-OrionApplicationTemplateId -ApplicationName 'apache' -SwisConnection $swis | should be 6
}
# test 2: it returns nothing ($null):
It 'throws an error when an application template does not exist' {
Get-OrionapplicationTemplateId -ApplicationName 'doesnotexist' -SwisConnection $swis -ErrorAction SilentlyContinue | Should throw
Get-OrionApplicationTemplateId -ApplicationName 'doesnotexist' -SwisConnection $swis -ErrorAction SilentlyContinue | Should throw
}
}
}
# describes the function Get-OrionApplicationCredential
Describe 'Get-OrionApplicationCredential' {

# scenario 1: call the function without arguments
Context 'Running without arguments' {
# test 1: it does not throw an exception:
It 'runs without errors' {
# Gotcha: to use the "Should Not Throw" assertion,
# make sure you place the command in a
# scriptblock (braces):
{ Get-OrionApplicationCredential -SwisConnection $swis -credential 'AppCred' } | Should Not Throw
}

# test 2: it returns nothing ($null):
It 'does not return anything' {
Get-OrionApplicationCredential -SwisConnection $swis -credential 'AppCred' | Should Be 6
}
}
}
Expand Down
Binary file modified Samples/PowerShell/PowerOrion/PowerOrion.psd1
Binary file not shown.

0 comments on commit 55c61ee

Please sign in to comment.