diff --git a/test/powershell/Select-XML.Tests.ps1 b/test/powershell/Select-XML.Tests.ps1 new file mode 100644 index 000000000..5eff5b359 --- /dev/null +++ b/test/powershell/Select-XML.Tests.ps1 @@ -0,0 +1,28 @@ + +Describe "Select-XML DRT Unit Tests" -Tags DRT{ + + BeforeAll { + $testfile = Join-Path -Path $TestDrive -ChildPath "testfile.xml" + $xmlContent = @" + + + + Harry Potter + 30.00 + + + Learning XML + 25.00 + + +"@ + $xmlContent >$testfile + } + + It "Select-XML should work"{ + $results = Select-XML -Path $testfile -XPath "/bookstore/book/title" + $results.Count | Should Be 2 + $results[0].Node."#text" | Should Be "Harry Potter" + $results[1].Node."#text" | Should Be "Learning XML" + } +}