File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,22 @@ public void ManualProvisioning_WithNoContent_ShouldBeIgnored()
80
80
Assert . That ( elements , Is . Empty ) ;
81
81
}
82
82
83
+ [ Test ( Description = "Reading image from a local base image url." ) ]
84
+ public async Task FileSystem_LocalImage_WithBaseUri_ShouldSucceed ( )
85
+ {
86
+ string baseUri = TestContext . CurrentContext . WorkDirectory ;
87
+
88
+ using var resourceStream = ResourceHelper . GetStream ( "Resources.html2openxml.jpg" ) ;
89
+ using ( var fileStream = File . OpenWrite ( Path . Combine ( baseUri , "html2openxml.jpg" ) ) )
90
+ await resourceStream . CopyToAsync ( fileStream ) ;
91
+
92
+ converter = new ( mainPart , new IO . DefaultWebRequest { BaseImageUrl = new Uri ( baseUri ) } ) ;
93
+
94
+ var elements = await converter . ParseAsync ( "<img src='html2openxml.jpg'>" ) ;
95
+ Assert . That ( elements . Count ( ) , Is . EqualTo ( 1 ) ) ;
96
+ AssertIsImg ( mainPart , elements . First ( ) ) ;
97
+ }
98
+
83
99
[ Test ( Description = "Reading local file containing a space in the name" ) ]
84
100
public async Task FileSystem_LocalImage_WithSpaceInName_ShouldSucceed ( )
85
101
{
You can’t perform that action at this time.
0 commit comments