Skip to content

Commit

Permalink
#4 Added Get-IshMetadataField tests on public IshFields with methods …
Browse files Browse the repository at this point in the history
…AddField and ToXml for API Testing
  • Loading branch information
ddemeyer committed Mar 10, 2017
1 parent 9508496 commit 752bede
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion BACKLOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
1. [ISHREMOTE-029] Overload `Set-IshValueField` to accept IshObject/IshFolder
1. [ISHREMOTE-035] Add `Get-IshSettingWorkflow` which in turn requires `IshSettingWorkflowSetup` and `IshSettingWorkflowTransition`
1. [ISHREMOTE-031] Extend parameter `-FolderPath` with intellisense
1. [ISHREMOTE-006] Add Missing/Legacy Pester tests
1. [ISHREMOTE-006] Add Missing/Legacy Pester tests Issue #4
1. [ISHREMOTE-016] Add `Filter-IshObject` cmdlet taking MetadataFilter parameter to do client-side object filtering
1. [ISHREMOTE-014] Add `Test-IshFolder`
1. [ISHREMOTE-027] Add `Test-IshDocumentObj` and `Test-PublicationOutput`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,28 @@ Describe “Get-IshMetadataField" -Tags "Read" {
(Get-IshEvent -IshSession $ishSession -ModifiedSince (Get-Date).AddMonths(-3) | Get-IshMetadataField -IshSession $ishSession -Name "EVENTTYPE" -Level Progress).Count -ge 0 | Should Be $true
}
}

Context "Get-IshMetadataField IshFields.ToXml() for API Testing" {
It "Trisoft.ISHRemote.Objects.IShFields is public" {
{ New-Object -TypeName Trisoft.ISHRemote.Objects.IShFields } | Should Not Throw
}
It "Trisoft.ISHRemote.Objects.IShFields.AddField() is public" {
{ (New-Object -TypeName Trisoft.ISHRemote.Objects.IShFields).AddField((Set-IshRequestedMetadataField -IshSession $ishSession -Name "USERNAME")).ToXml() } | Should Not Throw
}
It "Trisoft.ISHRemote.Objects.IShFields.ToXml() xml content single" {
$ishFields = New-Object -TypeName Trisoft.ISHRemote.Objects.IShFields
$ishFields.AddField((Set-IshRequestedMetadataField -IshSession $ishSession -Name "USERNAME"))
$result = '<?xml version="1.0" encoding="utf-16"?><ishfields><ishfield name="USERNAME" level="none" ishvaluetype="value" /></ishfields>'
$ishFields.ToXML() -eq $result | Should Be $true
}
It "Trisoft.ISHRemote.Objects.IShFields.ToXml() xml content multiple" {
$ishFields = New-Object -TypeName Trisoft.ISHRemote.Objects.IShFields
$ishFields.AddField((Set-IshRequestedMetadataField -IshSession $ishSession -Name "USERNAME"))
$ishFields.AddField((Set-IshRequestedMetadataField -IshSession $ishSession -Name "FUSERGROUP"))
$result = '<?xml version="1.0" encoding="utf-16"?><ishfields><ishfield name="USERNAME" level="none" ishvaluetype="value" /><ishfield name="FUSERGROUP" level="none" ishvaluetype="value" /></ishfields>'
$ishFields.ToXML() -eq $result | Should Be $true
}
}
}


Expand Down

0 comments on commit 752bede

Please sign in to comment.