@@ -17,6 +17,8 @@ public class IntegrationTest
17
17
private const string pngBlack4x4px = "../../../TestData/BlackDoubleSize.png" ;
18
18
private const string pngWhite2x2px = "../../../TestData/White.png" ;
19
19
private const string pngTransparent2x2px = "../../../TestData/pngTransparent2x2px.png" ;
20
+ private const string renderdForm1 = "../../../TestData/HC007-Test-02-3-OxPt.html1.png" ;
21
+ private const string renderdForm2 = "../../../TestData/HC007-Test-02-3-OxPt.html2.png" ;
20
22
21
23
[ Test ]
22
24
[ TestCase ( jpg0Rgb24 , jpg0Rgb24 , true ) ]
@@ -131,6 +133,8 @@ public void ShouldVerifyThatImageSharpImagesAreEqual(string pathActual, string p
131
133
[ TestCase ( pngBlack2x2px , pngWhite2x2px , 3060 , 765 , 4 , 100.0d , ResizeOption . DontResize ) ]
132
134
[ TestCase ( pngBlack2x2px , pngBlack4x4px , 0 , 0 , 0 , 0 , ResizeOption . Resize ) ]
133
135
[ TestCase ( pngBlack4x4px , pngWhite2x2px , 12240 , 765 , 16 , 100.0d , ResizeOption . Resize ) ]
136
+ [ TestCase ( renderdForm1 , renderdForm2 , 50103469 , 61.825603405725566d , 220164 , 27.167324777887465d , ResizeOption . Resize ) ]
137
+ [ TestCase ( renderdForm2 , renderdForm1 , 50103469 , 61.825603405725566d , 220164 , 27.167324777887465d , ResizeOption . Resize ) ]
134
138
public void ShouldVerifyThatImagesAreSemiEqual ( string pathPic1 , string pathPic2 , int expectedAbsoluteError , double expectedMeanError , int expectedPixelErrorCount , double expectedPixelErrorPercentage , ResizeOption resizeOption )
135
139
{
136
140
var absolutePathPic1 = Path . Combine ( AppContext . BaseDirectory , pathPic1 ) ;
@@ -193,7 +197,10 @@ public void ShouldVerifyThatImageStreamsAreSemiEqual(string pathPic1, string pat
193
197
[ TestCase ( png0Rgba32 , png1Rgba32 , 0 , 0 , 0 , 0 , ResizeOption . DontResize ) ]
194
198
[ TestCase ( png0Rgba32 , png1Rgba32 , 0 , 0 , 0 , 0 , ResizeOption . Resize ) ]
195
199
[ TestCase ( pngWhite2x2px , pngBlack4x4px , 0 , 0 , 0 , 0 , ResizeOption . Resize ) ]
196
- public void Diffmask ( string pathPic1 , string pathPic2 , int expectedMeanError , int expectedAbsoluteError , int expectedPixelErrorCount , double expectedPixelErrorPercentage , ResizeOption resizeOption )
200
+ [ TestCase ( pngBlack4x4px , pngWhite2x2px , 0 , 0 , 0 , 0 , ResizeOption . Resize ) ]
201
+ [ TestCase ( renderdForm1 , renderdForm2 , 0 , 0 , 0 , 0 , ResizeOption . Resize ) ]
202
+ [ TestCase ( renderdForm2 , renderdForm1 , 0 , 0 , 0 , 0 , ResizeOption . Resize ) ]
203
+ public void CalcDiffMaskImage ( string pathPic1 , string pathPic2 , double expectedMeanError , int expectedAbsoluteError , int expectedPixelErrorCount , double expectedPixelErrorPercentage , ResizeOption resizeOption )
197
204
{
198
205
var absolutePathPic1 = Path . Combine ( AppContext . BaseDirectory , pathPic1 ) ;
199
206
var absolutePathPic2 = Path . Combine ( AppContext . BaseDirectory , pathPic2 ) ;
@@ -378,5 +385,19 @@ public void ShouldVerifyThatImageWithDifferentSizeThrows(string pathPic1, string
378
385
379
386
Assert . That ( exception ? . Message , Is . EqualTo ( "Size of images differ." ) ) ;
380
387
}
388
+
389
+ [ TestCase ( png0Rgba32 , png0Rgba32 , pngBlack2x2px ) ]
390
+ [ TestCase ( png0Rgba32 , pngBlack2x2px , png0Rgba32 ) ]
391
+ [ TestCase ( pngBlack2x2px , png0Rgba32 , png0Rgba32 ) ]
392
+ public void ShouldVerifyThatImageWithDifferentSizeThrows ( string pathPic1 , string pathPic2 , string pathPic3 )
393
+ {
394
+ var absolutePathPic1 = Path . Combine ( AppContext . BaseDirectory , pathPic1 ) ;
395
+ var absolutePathPic2 = Path . Combine ( AppContext . BaseDirectory , pathPic2 ) ;
396
+ var absolutePathPic3 = Path . Combine ( AppContext . BaseDirectory , pathPic3 ) ;
397
+
398
+ var exception = Assert . Throws < ImageSharpCompareException > ( ( ) => ImageSharpCompare . CalcDiff ( absolutePathPic1 , absolutePathPic2 , absolutePathPic3 ) ) ;
399
+
400
+ Assert . That ( exception ? . Message , Is . EqualTo ( "Size of images differ." ) ) ;
401
+ }
381
402
}
382
403
}
0 commit comments