Reduced number of proccess in tests to be appveyor freindly

This commit is contained in:
jhoneill
2018-08-12 15:03:33 +01:00
parent e46fe6d3e9
commit dc8a096732

View File

@@ -403,7 +403,7 @@ Describe ExportExcel {
Context "#Examples 8 & 9 # Adding Pivot tables and charts from parameters" { Context "#Examples 8 & 9 # Adding Pivot tables and charts from parameters" {
$path = "$env:TEMP\Test.xlsx" $path = "$env:TEMP\Test.xlsx"
#This time we are not deleting the XLSX file so this Should create a new, named, sheet. #This time we are not deleting the XLSX file so this Should create a new, named, sheet.
$Excel = Get-Process | Select-Object -first 50 -Property Name, cpu, pm, handles, company | Export-Excel $path -WorkSheetname Processes -PassThru $Excel = Get-Process | Select-Object -first 20 -Property Name, cpu, pm, handles, company | Export-Excel $path -WorkSheetname Processes -PassThru
#Testing -passthru and adding the Pivot as a second step. Want to save and re-open it ... #Testing -passthru and adding the Pivot as a second step. Want to save and re-open it ...
Export-Excel -ExcelPackage $Excel -WorkSheetname Processes -IncludePivotTable -PivotRows Company -PivotData PM -NoTotalsInPivot Export-Excel -ExcelPackage $Excel -WorkSheetname Processes -IncludePivotTable -PivotRows Company -PivotData PM -NoTotalsInPivot
@@ -415,7 +415,7 @@ Describe ExportExcel {
$PTws.PivotTables.Count | Should be 1 $PTws.PivotTables.Count | Should be 1
$Excel.Workbook.Worksheets["Processes"] | Should not beNullOrEmpty $Excel.Workbook.Worksheets["Processes"] | Should not beNullOrEmpty
$Excel.Workbook.Worksheets.Count | Should beGreaterThan 2 $Excel.Workbook.Worksheets.Count | Should beGreaterThan 2
# $excel.Workbook.Worksheets["Processes"].Dimension.rows | Should be 51 #50 data + 1 header $excel.Workbook.Worksheets["Processes"].Dimension.rows | Should be 21 #20 data + 1 header
} }
$pt = $PTws.PivotTables[0] $pt = $PTws.PivotTables[0]
it "Built the expected Pivot table " { it "Built the expected Pivot table " {
@@ -440,14 +440,14 @@ Describe ExportExcel {
$warnVar | Should not beNullOrEmpty $warnVar | Should not beNullOrEmpty
} }
$warnVar = $null $warnVar = $null
Get-Process | Select-Object -Last 50 -Property Name, cpu, pm, handles, company | Export-Excel $path -WorkSheetname Processes -Append -IncludePivotTable -PivotRows Company -PivotData PM -IncludePivotChart -ChartType PieExploded3D -WarningAction SilentlyContinue -WarningVariable warnvar Get-Process | Select-Object -Last 20 -Property Name, cpu, pm, handles, company | Export-Excel $path -WorkSheetname Processes -Append -IncludePivotTable -PivotRows Company -PivotData PM -IncludePivotChart -ChartType PieExploded3D -WarningAction SilentlyContinue -WarningVariable warnvar
$Excel = Open-ExcelPackage $path $Excel = Open-ExcelPackage $path
$pt = $Excel.Workbook.Worksheets["ProcessesPivotTable"].PivotTables[0] $pt = $Excel.Workbook.Worksheets["ProcessesPivotTable"].PivotTables[0]
it "Appended to the Worksheet and Extended the Pivot table " { it "Appended to the Worksheet and Extended the Pivot table " {
$Excel.Workbook.Worksheets.Count | Should be $wCount $Excel.Workbook.Worksheets.Count | Should be $wCount
$excel.Workbook.Worksheets["Processes"].Dimension.rows | Should be 101 #appended 50 rows to the previous total $excel.Workbook.Worksheets["Processes"].Dimension.rows | Should be 41 #appended 20 rows to the previous total
$pt.CacheDefinition.CacheDefinitionXml.pivotCacheDefinition.cacheSource.worksheetSource.ref | $pt.CacheDefinition.CacheDefinitionXml.pivotCacheDefinition.cacheSource.worksheetSource.ref |
Should be "A1:E101" Should be "A1:E41"
} }
it "Generated a message on extending the Pivot table " { it "Generated a message on extending the Pivot table " {
$warnVar | Should not beNullOrEmpty $warnVar | Should not beNullOrEmpty