File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ Push-Location $PSScriptRoot
2+ describe OpenXML {
3+ it ' Is a zip in a trenchcoat' {
4+ $blankDocument = Get-OpenXML - FilePath ./ Examples/ Blank.docx
5+ $blankDocument.Parts.Count | Should - BeGreaterThan 1
6+ }
7+
8+ it ' Can access metadata' {
9+ $blankDocument = Get-OpenXML - FilePath ./ Examples/ Blank.docx
10+ $blankDocument.Created | Should - BeLessThan ([DateTime ]::Now)
11+ $blankDocument.Modified | Should - BeLessThan ([DateTime ]::Now)
12+ }
13+
14+
15+ context Excel {
16+ it ' Can Get Cells' {
17+ $helloExcel = OpenXML ./ Examples/ HelloWorld.xlsx
18+ $helloExcel.Text -replace ' ^[\n\r]' | Should - Be ' Hello World'
19+ }
20+ }
21+ context PowerPoint {
22+ it ' Can Get Text' {
23+ $helloPowerPoint = OpenXML ./ Examples/ HelloWorld.pptx
24+ $helloPowerPoint.Text -replace ' ^[\n\r]' | Should - Be ' Hello World'
25+ }
26+ it ' Can Get Slides' {
27+ $aSlideDeck = OpenXML ./ Examples/ ASlideDeck.pptx
28+ $aSlideDeck.Slides.Count | Should - BeGreaterThan 1
29+ $aSlideDeck.Slides.SlideNumber | Should - BeGreaterOrEqual 1
30+ }
31+ }
32+
33+ context Word {
34+ it ' Can Get Text' {
35+ $helloWorld = Get-OpenXML - FilePath ./ Examples/ HelloWorld.docx
36+ $helloWorld.Text -replace ' ^[\n\r]+' | Should - Be ' Hello World'
37+ }
38+ }
39+
40+
41+ }
42+
43+ Pop-Location
You can’t perform that action at this time.
0 commit comments