mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Update Pester Syntax from V3 to V4 (V5 won't support the old version)
This commit is contained in:
@@ -31,29 +31,29 @@ Describe "Compare Worksheet" {
|
||||
}
|
||||
Context "Simple comparison output" {
|
||||
it "Found the right number of differences " {
|
||||
$comp | should not beNullOrEmpty
|
||||
$comp.Count | should be 4
|
||||
$comp | Should -Not -BeNullOrEmpty
|
||||
$comp.Count | Should -Be 4
|
||||
}
|
||||
it "Found the data row with a changed property " {
|
||||
$comp | should not beNullOrEmpty
|
||||
$comp[0]._Side | should not be $comp[1]._Side
|
||||
$comp[0]._Row | should be 4
|
||||
$comp[1]._Row | should be 4
|
||||
$comp[1].Name | should be $comp[0].Name
|
||||
$comp[0].DisplayName | should be $row4Displayname
|
||||
$comp[1].DisplayName | should be "Changed from the orginal"
|
||||
$comp | Should -Not -BeNullOrEmpty
|
||||
$comp[0]._Side | Should -Not -Be $comp[1]._Side
|
||||
$comp[0]._Row | Should -Be 4
|
||||
$comp[1]._Row | Should -Be 4
|
||||
$comp[1].Name | Should -Be $comp[0].Name
|
||||
$comp[0].DisplayName | Should -Be $row4Displayname
|
||||
$comp[1].DisplayName | Should -Be "Changed from the orginal"
|
||||
}
|
||||
it "Found the inserted data row " {
|
||||
$comp | should not beNullOrEmpty
|
||||
$comp[2]._Side | should be '=>'
|
||||
$comp[2]._Row | should be 5
|
||||
$comp[2].Name | should be "Dummy"
|
||||
$comp | Should -Not -BeNullOrEmpty
|
||||
$comp[2]._Side | Should -Be '=>'
|
||||
$comp[2]._Row | Should -Be 5
|
||||
$comp[2].Name | Should -Be "Dummy"
|
||||
}
|
||||
it "Found the deleted data row " {
|
||||
$comp | should not beNullOrEmpty
|
||||
$comp[3]._Side | should be '<='
|
||||
$comp[3]._Row | should be 6
|
||||
$comp[3].Name | should be $row6Name
|
||||
$comp | Should -Not -BeNullOrEmpty
|
||||
$comp[3]._Side | Should -Be '<='
|
||||
$comp[3]._Row | Should -Be 6
|
||||
$comp[3].Name | Should -Be $row6Name
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,16 +75,16 @@ Describe "Compare Worksheet" {
|
||||
$s2Sheet = $xl2.Workbook.Worksheets[1]
|
||||
}
|
||||
it "Set the background on the right rows " {
|
||||
$s1Sheet.Cells["4:4"].Style.Fill.BackgroundColor.Rgb | should be "FF90EE90"
|
||||
$s1Sheet.Cells["6:6"].Style.Fill.BackgroundColor.Rgb | should be "FF90EE90"
|
||||
$s2Sheet.Cells["4:4"].Style.Fill.BackgroundColor.Rgb | should be "FF90EE90"
|
||||
$s2Sheet.Cells["5:5"].Style.Fill.BackgroundColor.Rgb | should be "FF90EE90"
|
||||
$s1Sheet.Cells["4:4"].Style.Fill.BackgroundColor.Rgb | Should -Be "FF90EE90"
|
||||
$s1Sheet.Cells["6:6"].Style.Fill.BackgroundColor.Rgb | Should -Be "FF90EE90"
|
||||
$s2Sheet.Cells["4:4"].Style.Fill.BackgroundColor.Rgb | Should -Be "FF90EE90"
|
||||
$s2Sheet.Cells["5:5"].Style.Fill.BackgroundColor.Rgb | Should -Be "FF90EE90"
|
||||
}
|
||||
it "Didn't set other cells " {
|
||||
$s1Sheet.Cells["3:3"].Style.Fill.BackgroundColor.Rgb | should not be "FF90EE90"
|
||||
$s1Sheet.Cells["F4"].Style.Font.Color.Rgb | should beNullOrEmpty
|
||||
$s2Sheet.Cells["F4"].Style.Font.Color.Rgb | should beNullOrEmpty
|
||||
$s2Sheet.Cells["3:3"].Style.Fill.BackgroundColor.Rgb | should not be "FF90EE90"
|
||||
$s1Sheet.Cells["3:3"].Style.Fill.BackgroundColor.Rgb | Should -Not -Be "FF90EE90"
|
||||
$s1Sheet.Cells["F4"].Style.Font.Color.Rgb | Should -BeNullOrEmpty
|
||||
$s2Sheet.Cells["F4"].Style.Font.Color.Rgb | Should -BeNullOrEmpty
|
||||
$s2Sheet.Cells["3:3"].Style.Fill.BackgroundColor.Rgb | Should -Not -Be "FF90EE90"
|
||||
}
|
||||
AfterAll {
|
||||
Close-ExcelPackage -ExcelPackage $xl1 -NoSave
|
||||
@@ -101,18 +101,18 @@ Describe "Compare Worksheet" {
|
||||
$s2Sheet = $xl2.Workbook.Worksheets[1]
|
||||
}
|
||||
it "Added foreground colour to the right cells " {
|
||||
$s1Sheet.Cells["4:4"].Style.Fill.BackgroundColor.Rgb | should be "FF90EE90"
|
||||
$s1Sheet.Cells["6:6"].Style.Fill.BackgroundColor.Rgb | should be "FF90EE90"
|
||||
$s2Sheet.Cells["4:4"].Style.Fill.BackgroundColor.Rgb | should be "FF90EE90"
|
||||
$s2Sheet.Cells["5:5"].Style.Fill.BackgroundColor.Rgb | should be "FF90EE90"
|
||||
# $s1Sheet.Cells["F4"].Style.Font.Color.Rgb | should be "FF8B0000"
|
||||
$s2Sheet.Cells["F4"].Style.Font.Color.Rgb | should be "FF8B0000"
|
||||
$s1Sheet.Cells["4:4"].Style.Fill.BackgroundColor.Rgb | Should -Be "FF90EE90"
|
||||
$s1Sheet.Cells["6:6"].Style.Fill.BackgroundColor.Rgb | Should -Be "FF90EE90"
|
||||
$s2Sheet.Cells["4:4"].Style.Fill.BackgroundColor.Rgb | Should -Be "FF90EE90"
|
||||
$s2Sheet.Cells["5:5"].Style.Fill.BackgroundColor.Rgb | Should -Be "FF90EE90"
|
||||
# $s1Sheet.Cells["F4"].Style.Font.Color.Rgb | Should -Be "FF8B0000"
|
||||
$s2Sheet.Cells["F4"].Style.Font.Color.Rgb | Should -Be "FF8B0000"
|
||||
}
|
||||
it "Didn't set the foreground on other cells " {
|
||||
$s1Sheet.Cells["F5"].Style.Font.Color.Rgb | should beNullOrEmpty
|
||||
$s2Sheet.Cells["F5"].Style.Font.Color.Rgb | should beNullOrEmpty
|
||||
$s1Sheet.Cells["G4"].Style.Font.Color.Rgb | should beNullOrEmpty
|
||||
$s2Sheet.Cells["G4"].Style.Font.Color.Rgb | should beNullOrEmpty
|
||||
$s1Sheet.Cells["F5"].Style.Font.Color.Rgb | Should -BeNullOrEmpty
|
||||
$s2Sheet.Cells["F5"].Style.Font.Color.Rgb | Should -BeNullOrEmpty
|
||||
$s1Sheet.Cells["G4"].Style.Font.Color.Rgb | Should -BeNullOrEmpty
|
||||
$s2Sheet.Cells["G4"].Style.Font.Color.Rgb | Should -BeNullOrEmpty
|
||||
|
||||
}
|
||||
AfterAll {
|
||||
@@ -146,46 +146,46 @@ Describe "Compare Worksheet" {
|
||||
$s2Sheet = $xl2.Workbook.Worksheets["server2"]
|
||||
}
|
||||
it "Found the right number of differences " {
|
||||
$comp | should not beNullOrEmpty
|
||||
$comp.Count | should be 4
|
||||
$comp | Should -Not -BeNullOrEmpty
|
||||
$comp.Count | Should -Be 4
|
||||
}
|
||||
it "Found the data row with a changed property " {
|
||||
$comp | should not beNullOrEmpty
|
||||
$comp[0]._Side | should not be $comp[1]._Side
|
||||
$comp[0]._Row | should be 4
|
||||
$comp[1]._Row | should be 4
|
||||
$comp[1].ServiceName | should be $comp[0].ServiceName
|
||||
$comp[0].DisplayName | should be $row4Displayname
|
||||
$comp[1].DisplayName | should be "Changed from the orginal"
|
||||
$comp | Should -Not -BeNullOrEmpty
|
||||
$comp[0]._Side | Should -Not -Be $comp[1]._Side
|
||||
$comp[0]._Row | Should -Be 4
|
||||
$comp[1]._Row | Should -Be 4
|
||||
$comp[1].ServiceName | Should -Be $comp[0].ServiceName
|
||||
$comp[0].DisplayName | Should -Be $row4Displayname
|
||||
$comp[1].DisplayName | Should -Be "Changed from the orginal"
|
||||
}
|
||||
it "Found the inserted data row " {
|
||||
$comp | should not beNullOrEmpty
|
||||
$comp[2]._Side | should be '=>'
|
||||
$comp[2]._Row | should be 5
|
||||
$comp[2].ServiceName | should be "Dummy"
|
||||
$comp | Should -Not -BeNullOrEmpty
|
||||
$comp[2]._Side | Should -Be '=>'
|
||||
$comp[2]._Row | Should -Be 5
|
||||
$comp[2].ServiceName | Should -Be "Dummy"
|
||||
}
|
||||
it "Found the deleted data row " {
|
||||
$comp | should not beNullOrEmpty
|
||||
$comp[3]._Side | should be '<='
|
||||
$comp[3]._Row | should be 6
|
||||
$comp[3].ServiceName | should be $row6Name
|
||||
$comp | Should -Not -BeNullOrEmpty
|
||||
$comp[3]._Side | Should -Be '<='
|
||||
$comp[3]._Row | Should -Be 6
|
||||
$comp[3].ServiceName | Should -Be $row6Name
|
||||
}
|
||||
it "Set the background on the right rows " {
|
||||
$s1Sheet.Cells["4:4"].Style.Fill.BackgroundColor.Rgb | should be "FFFFFFFF"
|
||||
$s1Sheet.Cells["6:6"].Style.Fill.BackgroundColor.Rgb | Should be "FFFFFFFF"
|
||||
$s2Sheet.Cells["4:4"].Style.Fill.BackgroundColor.Rgb | Should be "FFFFFFFF"
|
||||
$s2Sheet.Cells["5:5"].Style.Fill.BackgroundColor.Rgb | Should be "FFFFFFFF"
|
||||
$s1Sheet.Cells["4:4"].Style.Fill.BackgroundColor.Rgb | Should -Be "FFFFFFFF"
|
||||
$s1Sheet.Cells["6:6"].Style.Fill.BackgroundColor.Rgb | Should -Be "FFFFFFFF"
|
||||
$s2Sheet.Cells["4:4"].Style.Fill.BackgroundColor.Rgb | Should -Be "FFFFFFFF"
|
||||
$s2Sheet.Cells["5:5"].Style.Fill.BackgroundColor.Rgb | Should -Be "FFFFFFFF"
|
||||
|
||||
$s1Sheet.Cells["E4"].Style.Font.Color.Rgb | Should be "FFFF0000"
|
||||
$s2Sheet.Cells["E4"].Style.Font.Color.Rgb | Should be "FFFF0000"
|
||||
$s1Sheet.Cells["E4"].Style.Font.Color.Rgb | Should -Be "FFFF0000"
|
||||
$s2Sheet.Cells["E4"].Style.Font.Color.Rgb | Should -Be "FFFF0000"
|
||||
}
|
||||
it "Didn't set other cells " {
|
||||
$s1Sheet.Cells["3:3"].Style.Fill.BackgroundColor.Rgb | Should not be "FFFFFFFF"
|
||||
$s2Sheet.Cells["3:3"].Style.Fill.BackgroundColor.Rgb | Should not be "FFFFFFFF"
|
||||
$s1Sheet.Cells["E5"].Style.Font.Color.Rgb | Should beNullOrEmpty
|
||||
$s2Sheet.Cells["E5"].Style.Font.Color.Rgb | Should beNullOrEmpty
|
||||
$s1Sheet.Cells["F4"].Style.Font.Color.Rgb | Should beNullOrEmpty
|
||||
$s2Sheet.Cells["F4"].Style.Font.Color.Rgb | Should beNullOrEmpty
|
||||
$s1Sheet.Cells["3:3"].Style.Fill.BackgroundColor.Rgb | Should -Not -Be "FFFFFFFF"
|
||||
$s2Sheet.Cells["3:3"].Style.Fill.BackgroundColor.Rgb | Should -Not -Be "FFFFFFFF"
|
||||
$s1Sheet.Cells["E5"].Style.Font.Color.Rgb | Should -BeNullOrEmpty
|
||||
$s2Sheet.Cells["E5"].Style.Font.Color.Rgb | Should -BeNullOrEmpty
|
||||
$s1Sheet.Cells["F4"].Style.Font.Color.Rgb | Should -BeNullOrEmpty
|
||||
$s2Sheet.Cells["F4"].Style.Font.Color.Rgb | Should -BeNullOrEmpty
|
||||
}
|
||||
AfterAll {
|
||||
Close-ExcelPackage -ExcelPackage $xl1 -NoSave # -Show
|
||||
@@ -219,44 +219,44 @@ Describe "Merge Worksheet" {
|
||||
}
|
||||
Context "Merge with 3 properties" {
|
||||
it "Created a worksheet with the correct headings " {
|
||||
$ws | should not beNullOrEmpty
|
||||
$ws.Cells[ 1,1].Value | Should be "name"
|
||||
$ws.Cells[ 1,2].Value | Should be "DisplayName"
|
||||
$ws.Cells[ 1,3].Value | Should be "StartType"
|
||||
$ws.Cells[ 1,4].Value | Should be "server2 DisplayName"
|
||||
$ws.Cells[ 1,5].Value | Should be "server2 StartType"
|
||||
$ws | Should -Not -BeNullOrEmpty
|
||||
$ws.Cells[ 1,1].Value | Should -Be "name"
|
||||
$ws.Cells[ 1,2].Value | Should -Be "DisplayName"
|
||||
$ws.Cells[ 1,3].Value | Should -Be "StartType"
|
||||
$ws.Cells[ 1,4].Value | Should -Be "server2 DisplayName"
|
||||
$ws.Cells[ 1,5].Value | Should -Be "server2 StartType"
|
||||
}
|
||||
it "Joined the two sheets correctly " {
|
||||
$ws.Cells[ 2,2].Value | Should be $ws.Cells[ 2,4].Value
|
||||
$ws.Cells[ 2,3].Value | Should be $ws.Cells[ 2,5].Value
|
||||
$ws.cells[ 4,4].value | Should be "Changed from the orginal"
|
||||
$ws.cells[ 5,1].value | Should be "Dummy"
|
||||
$ws.cells[ 5,2].value | Should beNullOrEmpty
|
||||
$ws.cells[ 5,3].value | Should beNullOrEmpty
|
||||
$ws.cells[ 5,4].value | Should be "Dummy Service"
|
||||
$ws.cells[ 7,4].value | Should beNullOrEmpty
|
||||
$ws.cells[ 7,5].value | Should beNullOrEmpty
|
||||
$ws.Cells[12,2].Value | Should be $ws.Cells[12,4].Value
|
||||
$ws.Cells[12,3].Value | Should be $ws.Cells[12,5].Value
|
||||
$ws.Cells[ 2,2].Value | Should -Be $ws.Cells[ 2,4].Value
|
||||
$ws.Cells[ 2,3].Value | Should -Be $ws.Cells[ 2,5].Value
|
||||
$ws.cells[ 4,4].value | Should -Be "Changed from the orginal"
|
||||
$ws.cells[ 5,1].value | Should -Be "Dummy"
|
||||
$ws.cells[ 5,2].value | Should -BeNullOrEmpty
|
||||
$ws.cells[ 5,3].value | Should -BeNullOrEmpty
|
||||
$ws.cells[ 5,4].value | Should -Be "Dummy Service"
|
||||
$ws.cells[ 7,4].value | Should -BeNullOrEmpty
|
||||
$ws.cells[ 7,5].value | Should -BeNullOrEmpty
|
||||
$ws.Cells[12,2].Value | Should -Be $ws.Cells[12,4].Value
|
||||
$ws.Cells[12,3].Value | Should -Be $ws.Cells[12,5].Value
|
||||
}
|
||||
it "Highlighted the keys in the added / deleted / changed rows " {
|
||||
$ws.cells[4,1].Style.font.color.rgb | Should be "FF8b0000"
|
||||
$ws.cells[5,1].Style.font.color.rgb | Should be "FF8b0000"
|
||||
$ws.cells[7,1].Style.font.color.rgb | Should be "FF8b0000"
|
||||
$ws.cells[4,1].Style.font.color.rgb | Should -Be "FF8b0000"
|
||||
$ws.cells[5,1].Style.font.color.rgb | Should -Be "FF8b0000"
|
||||
$ws.cells[7,1].Style.font.color.rgb | Should -Be "FF8b0000"
|
||||
}
|
||||
it "Set the background for the added / deleted / changed rows " {
|
||||
$ws.cells["A3:E3"].style.Fill.BackgroundColor.Rgb | Should beNullOrEmpty
|
||||
$ws.cells["A4:E4"].style.Fill.BackgroundColor.Rgb | Should be "FFFFA500"
|
||||
$ws.cells["A5" ].style.Fill.BackgroundColor.Rgb | Should be "FF98FB98"
|
||||
$ws.cells["B5:C5"].style.Fill.BackgroundColor.rgb | Should beNullOrEmpty
|
||||
$ws.cells["D5:E5"].style.Fill.BackgroundColor.Rgb | Should be "FF98FB98"
|
||||
$ws.cells["A7:C7"].style.Fill.BackgroundColor.Rgb | Should be "FFFFB6C1"
|
||||
$ws.cells["D7:E7"].style.Fill.BackgroundColor.rgb | Should beNullOrEmpty
|
||||
$ws.cells["A3:E3"].style.Fill.BackgroundColor.Rgb | Should -BeNullOrEmpty
|
||||
$ws.cells["A4:E4"].style.Fill.BackgroundColor.Rgb | Should -Be "FFFFA500"
|
||||
$ws.cells["A5" ].style.Fill.BackgroundColor.Rgb | Should -Be "FF98FB98"
|
||||
$ws.cells["B5:C5"].style.Fill.BackgroundColor.rgb | Should -BeNullOrEmpty
|
||||
$ws.cells["D5:E5"].style.Fill.BackgroundColor.Rgb | Should -Be "FF98FB98"
|
||||
$ws.cells["A7:C7"].style.Fill.BackgroundColor.Rgb | Should -Be "FFFFB6C1"
|
||||
$ws.cells["D7:E7"].style.Fill.BackgroundColor.rgb | Should -BeNullOrEmpty
|
||||
}
|
||||
}
|
||||
Context "Wider data set" {
|
||||
it "Coped with columns beyond Z in the Output sheet " {
|
||||
{ Merge-Worksheet -Referencefile "TestDrive:\server1.xlsx" -Differencefile "TestDrive:\server2.xlsx" -OutputFile "TestDrive:\combined2.xlsx" } | Should not throw
|
||||
{ Merge-Worksheet -Referencefile "TestDrive:\server1.xlsx" -Differencefile "TestDrive:\server2.xlsx" -OutputFile "TestDrive:\combined2.xlsx" } | Should -Not -Throw
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -296,64 +296,64 @@ Describe "Merge Multiple sheets" {
|
||||
|
||||
}
|
||||
it "Created a worksheet with the correct headings " {
|
||||
$ws | Should not beNullOrEmpty
|
||||
$ws.Cells[ 1,2 ].Value | Should be "name"
|
||||
$ws.Cells[ 1,3 ].Value | Should be "server1 DisplayName"
|
||||
$ws.Cells[ 1,4 ].Value | Should be "server1 StartType"
|
||||
$ws.Cells[ 1,5 ].Value | Should be "server2 DisplayName"
|
||||
$ws.Cells[ 1,6 ].Value | Should be "server2 StartType"
|
||||
$ws.Column(7).hidden | Should be $true
|
||||
$ws.Cells[ 1,8].Value | Should be "server2 Row"
|
||||
$ws.Cells[ 1,9 ].Value | Should be "server3 DisplayName"
|
||||
$ws.Cells[ 1,10].Value | Should be "server3 StartType"
|
||||
$ws.Column(11).hidden | Should be $true
|
||||
$ws.Cells[ 1,12].Value | Should be "server3 Row"
|
||||
$ws | Should -Not -BeNullOrEmpty
|
||||
$ws.Cells[ 1,2 ].Value | Should -Be "name"
|
||||
$ws.Cells[ 1,3 ].Value | Should -Be "server1 DisplayName"
|
||||
$ws.Cells[ 1,4 ].Value | Should -Be "server1 StartType"
|
||||
$ws.Cells[ 1,5 ].Value | Should -Be "server2 DisplayName"
|
||||
$ws.Cells[ 1,6 ].Value | Should -Be "server2 StartType"
|
||||
$ws.Column(7).hidden | Should -Be $true
|
||||
$ws.Cells[ 1,8].Value | Should -Be "server2 Row"
|
||||
$ws.Cells[ 1,9 ].Value | Should -Be "server3 DisplayName"
|
||||
$ws.Cells[ 1,10].Value | Should -Be "server3 StartType"
|
||||
$ws.Column(11).hidden | Should -Be $true
|
||||
$ws.Cells[ 1,12].Value | Should -Be "server3 Row"
|
||||
}
|
||||
it "Joined the three sheets correctly " {
|
||||
$ws.Cells[ 2,3 ].Value | Should be $ws.Cells[ 2,5 ].Value
|
||||
$ws.Cells[ 2,4 ].Value | Should be $ws.Cells[ 2,6 ].Value
|
||||
$ws.Cells[ 2,5 ].Value | Should be $ws.Cells[ 2,9 ].Value
|
||||
$ws.Cells[ 2,6 ].Value | Should be $ws.Cells[ 2,10].Value
|
||||
$ws.cells[ 4,5 ].value | Should be "Changed from the orginal"
|
||||
$ws.cells[ 4,9 ].value | Should be $ws.Cells[ 4,3 ].Value
|
||||
$ws.cells[ 5,2 ].value | Should be "Dummy"
|
||||
$ws.cells[ 5,3 ].value | Should beNullOrEmpty
|
||||
$ws.cells[ 5,4 ].value | Should beNullOrEmpty
|
||||
$ws.cells[ 5,5 ].value | Should be "Dummy Service"
|
||||
$ws.cells[ 5,8 ].value | Should be ($ws.cells[ 4,1].value +1)
|
||||
$ws.cells[ 5,9 ].value | Should be $ws.cells[ 5,5 ].value
|
||||
$ws.cells[ 7,5 ].value | Should beNullOrEmpty
|
||||
$ws.cells[ 7,6 ].value | Should beNullOrEmpty
|
||||
$ws.cells[ 7,9 ].value | Should beNullOrEmpty
|
||||
$ws.cells[ 7,10].value | Should beNullOrEmpty
|
||||
$ws.cells[ 8,3 ].value | Should beNullOrEmpty
|
||||
$ws.cells[ 8,4 ].value | Should beNullOrEmpty
|
||||
$ws.cells[ 8,5 ].value | Should beNullOrEmpty
|
||||
$ws.cells[ 8,6 ].value | Should beNullOrEmpty
|
||||
$ws.cells[11,9 ].value | Should beNullOrEmpty
|
||||
$ws.cells[11,10].value | Should beNullOrEmpty
|
||||
$ws.Cells[12,3 ].Value | Should be $ws.Cells[12,5].Value
|
||||
$ws.Cells[12,4 ].Value | Should be $ws.Cells[12,6].Value
|
||||
$ws.Cells[12,9 ].Value | Should be $ws.Cells[12,5].Value
|
||||
$ws.Cells[12,10].Value | Should be $ws.Cells[12,6].Value
|
||||
$ws.Cells[ 2,3 ].Value | Should -Be $ws.Cells[ 2,5 ].Value
|
||||
$ws.Cells[ 2,4 ].Value | Should -Be $ws.Cells[ 2,6 ].Value
|
||||
$ws.Cells[ 2,5 ].Value | Should -Be $ws.Cells[ 2,9 ].Value
|
||||
$ws.Cells[ 2,6 ].Value | Should -Be $ws.Cells[ 2,10].Value
|
||||
$ws.cells[ 4,5 ].value | Should -Be "Changed from the orginal"
|
||||
$ws.cells[ 4,9 ].value | Should -Be $ws.Cells[ 4,3 ].Value
|
||||
$ws.cells[ 5,2 ].value | Should -Be "Dummy"
|
||||
$ws.cells[ 5,3 ].value | Should -BeNullOrEmpty
|
||||
$ws.cells[ 5,4 ].value | Should -BeNullOrEmpty
|
||||
$ws.cells[ 5,5 ].value | Should -Be "Dummy Service"
|
||||
$ws.cells[ 5,8 ].value | Should -Be ($ws.cells[ 4,1].value +1)
|
||||
$ws.cells[ 5,9 ].value | Should -Be $ws.cells[ 5,5 ].value
|
||||
$ws.cells[ 7,5 ].value | Should -BeNullOrEmpty
|
||||
$ws.cells[ 7,6 ].value | Should -BeNullOrEmpty
|
||||
$ws.cells[ 7,9 ].value | Should -BeNullOrEmpty
|
||||
$ws.cells[ 7,10].value | Should -BeNullOrEmpty
|
||||
$ws.cells[ 8,3 ].value | Should -BeNullOrEmpty
|
||||
$ws.cells[ 8,4 ].value | Should -BeNullOrEmpty
|
||||
$ws.cells[ 8,5 ].value | Should -BeNullOrEmpty
|
||||
$ws.cells[ 8,6 ].value | Should -BeNullOrEmpty
|
||||
$ws.cells[11,9 ].value | Should -BeNullOrEmpty
|
||||
$ws.cells[11,10].value | Should -BeNullOrEmpty
|
||||
$ws.Cells[12,3 ].Value | Should -Be $ws.Cells[12,5].Value
|
||||
$ws.Cells[12,4 ].Value | Should -Be $ws.Cells[12,6].Value
|
||||
$ws.Cells[12,9 ].Value | Should -Be $ws.Cells[12,5].Value
|
||||
$ws.Cells[12,10].Value | Should -Be $ws.Cells[12,6].Value
|
||||
}
|
||||
it "Created Conditional formatting rules " {
|
||||
$cf=$ws.ConditionalFormatting
|
||||
$cf.Count | Should be 17
|
||||
$cf[16].Address.Address | Should be 'B2:B1048576'
|
||||
$cf[16].Type | Should be 'Expression'
|
||||
$cf[16].Formula | Should be 'OR(G2<>"Same",K2<>"Same")'
|
||||
$cf[16].Style.Font.Color.Color.Name | Should be "FFFF0000"
|
||||
$cf[14].Address.Address | Should be 'D2:D1048576'
|
||||
$cf[14].Type | Should be 'Expression'
|
||||
$cf[14].Formula | Should be 'OR(G2="Added",K2="Added")'
|
||||
$cf[14].Style.Fill.BackgroundColor.Color.Name | Should be 'ffffb6c1'
|
||||
$cf[14].Style.Fill.PatternType.ToString() | Should be 'Solid'
|
||||
$cf[ 0].Address.Address | Should be 'F1:F1048576'
|
||||
$cf[ 0].Type | Should be 'Expression'
|
||||
$cf[ 0].Formula | Should be 'G1="Added"'
|
||||
$cf[ 0].Style.Fill.BackgroundColor.Color.Name | Should be 'ffffa500'
|
||||
$cf[ 0].Style.Fill.PatternType.ToString() | Should be 'Solid'
|
||||
$cf.Count | Should -Be 17
|
||||
$cf[16].Address.Address | Should -Be 'B2:B1048576'
|
||||
$cf[16].Type | Should -Be 'Expression'
|
||||
$cf[16].Formula | Should -Be 'OR(G2<>"Same",K2<>"Same")'
|
||||
$cf[16].Style.Font.Color.Color.Name | Should -Be "FFFF0000"
|
||||
$cf[14].Address.Address | Should -Be 'D2:D1048576'
|
||||
$cf[14].Type | Should -Be 'Expression'
|
||||
$cf[14].Formula | Should -Be 'OR(G2="Added",K2="Added")'
|
||||
$cf[14].Style.Fill.BackgroundColor.Color.Name | Should -Be 'ffffb6c1'
|
||||
$cf[14].Style.Fill.PatternType.ToString() | Should -Be 'Solid'
|
||||
$cf[ 0].Address.Address | Should -Be 'F1:F1048576'
|
||||
$cf[ 0].Type | Should -Be 'Expression'
|
||||
$cf[ 0].Formula | Should -Be 'G1="Added"'
|
||||
$cf[ 0].Style.Fill.BackgroundColor.Color.Name | Should -Be 'ffffa500'
|
||||
$cf[ 0].Style.Fill.PatternType.ToString() | Should -Be 'Solid'
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user