mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Update fixes based on James comments for DisplayXML Pester Test
This commit is contained in:
1 parent
1d6ab11ea8
commit
4005348f45
1 file changed
+2
-8
@@ -127,10 +127,7 @@ Describe "Format-List DRT basic functionality" -Tags DRT{
|
||||
|
||||
It "Format-List with multiple same class object should work" -Pending:($env:TRAVIS_OS_NAME -eq "osx"){
|
||||
Add-Type -TypeDefinition "public class TestClass{public TestClass(string name,int length){Name = name;Length = length;}public string Name;public int Length;}"
|
||||
$testobject1 = [TestClass]::New('name1',1)
|
||||
$testobject2 = [TestClass]::New('name2',2)
|
||||
$testobject3 = [TestClass]::New('name3',3)
|
||||
$testobjects = @($testobject1,$testobject2,$testobject3)
|
||||
$testobjects = [TestClass]::New('name1',1),[TestClass]::New('name2',2),[TestClass]::New('name3',3)
|
||||
$result = $testobjects|Format-List|Out-String
|
||||
$result | Should Match "Name : name1"
|
||||
$result | Should Match "Length : 1"
|
||||
@@ -143,10 +140,7 @@ Describe "Format-List DRT basic functionality" -Tags DRT{
|
||||
It "Format-List with multiple different class object should work" -Pending:($env:TRAVIS_OS_NAME -eq "osx"){
|
||||
Add-Type -TypeDefinition "public class TestClass{public TestClass(string name,int length){Name = name;Length = length;}public string Name;public int Length;}"
|
||||
Add-Type -TypeDefinition "public class TestClass2{public TestClass2(string name,string value,int length){Name = name;Value = value; Length = length;}public string Name;public string Value;public int Length;}"
|
||||
$testobject1 = [TestClass]::New('name1',1)
|
||||
$testobject2 = [TestClass2]::New('name2',"value2",2)
|
||||
$testobject3 = [TestClass]::New('name3',3)
|
||||
$testobjects = @($testobject1,$testobject2,$testobject3)
|
||||
$testobjects = [TestClass]::New('name1',1),[TestClass2]::New('name2',"value2",2),[TestClass]::New('name3',3)
|
||||
$result = $testobjects|Format-List|Out-String
|
||||
$result | Should Match "Name : name1"
|
||||
$result | Should Match "Length : 1"
|
||||
|
||||
Reference in new issue
Block a user