mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 20:56:02 +00:00
Based on standard practices, we need to have a copyright and license notice at the top of each source file. Removed existing copyrights and updated/added copyright notices for .h, .cpp, .cs, .ps1, and .psm1 files. Updated module manifests for consistency to have Author = "PowerShell" and Company = "Microsoft Corporation". Removed multiple line breaks. Separate PR coming to update contribution document for new source files: #6140 Manually reviewed each change. Fix #6073
31 lines
797 B
PowerShell
31 lines
797 B
PowerShell
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
# Licensed under the MIT License.
|
|
|
|
Describe "Select-XML DRT Unit Tests" -Tags "CI" {
|
|
|
|
BeforeAll {
|
|
$testfile = Join-Path -Path $TestDrive -ChildPath "testfile.xml"
|
|
$xmlContent = @"
|
|
<?xml version ="1.0" encoding="ISO-8859-1"?>
|
|
<bookstore>
|
|
<book category="CHILDREN">
|
|
<title lang="english">Harry Potter</title>
|
|
<price>30.00</price>
|
|
</book>
|
|
<book category="WEB">
|
|
<title lang="english">Learning XML</title>
|
|
<price>25.00</price>
|
|
</book>
|
|
</bookstore>
|
|
"@
|
|
$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"
|
|
}
|
|
}
|