@@ -85,7 +85,7 @@ public void DifferentPixmapsReportDifferenceCorrectly(uint firstColor, uint seco
8585 [ InlineData ( pngFirst , pngFirst ) ]
8686 [ InlineData ( jpgSecond , jpgSecond ) ]
8787 [ InlineData ( pngSecond , pngSecond ) ]
88- public void SameFilesReportNoDifference ( string first , string second )
88+ public void SameImagesReportNoDifference ( string first , string second )
8989 {
9090 using var firstImage = SKImage . FromEncodedData ( GetImagePath ( first ) ) ;
9191 using var secondImage = SKImage . FromEncodedData ( GetImagePath ( second ) ) ;
@@ -101,6 +101,18 @@ public void SameFilesReportNoDifference(string first, string second)
101101 [ InlineData ( jpgFirst , jpgSecond , 2259184 , 15870 , 0.05288166768853464 ) ]
102102 [ InlineData ( pngFirst , pngSecond , 2249290 , 12570 , 0.041885479700370536 ) ]
103103 public void SimilarFilesAreSimilar ( string first , string second , int expAbsError , int expPixError , double expPixPercent )
104+ {
105+ var result = SKPixelComparer . Compare ( GetImagePath ( first ) , GetImagePath ( second ) ) ;
106+
107+ Assert . Equal ( expAbsError , result . AbsoluteError ) ;
108+ Assert . Equal ( expPixError , result . ErrorPixelCount ) ;
109+ Assert . Equal ( expPixPercent , result . ErrorPixelPercentage ) ;
110+ }
111+
112+ [ Theory ]
113+ [ InlineData ( jpgFirst , jpgSecond , 2259184 , 15870 , 0.05288166768853464 ) ]
114+ [ InlineData ( pngFirst , pngSecond , 2249290 , 12570 , 0.041885479700370536 ) ]
115+ public void SimilarImagesAreSimilar ( string first , string second , int expAbsError , int expPixError , double expPixPercent )
104116 {
105117 using var firstImage = SKImage . FromEncodedData ( GetImagePath ( first ) ) ;
106118 using var secondImage = SKImage . FromEncodedData ( GetImagePath ( second ) ) ;
@@ -116,6 +128,18 @@ public void SimilarFilesAreSimilar(string first, string second, int expAbsError,
116128 [ InlineData ( jpgFirst , pngFirst , 884487 , 231040 , 0.7698664462986164 ) ]
117129 [ InlineData ( jpgSecond , pngSecond , 873399 , 221697 , 0.7387339055793991 ) ]
118130 public void SimilarFilesAreCompressedDifferent ( string first , string second , int expAbsError , int expPixError , double expPixPercent )
131+ {
132+ var result = SKPixelComparer . Compare ( GetImagePath ( first ) , GetImagePath ( second ) ) ;
133+
134+ Assert . Equal ( expAbsError , result . AbsoluteError ) ;
135+ Assert . Equal ( expPixError , result . ErrorPixelCount ) ;
136+ Assert . Equal ( expPixPercent , result . ErrorPixelPercentage ) ;
137+ }
138+
139+ [ Theory ]
140+ [ InlineData ( jpgFirst , pngFirst , 884487 , 231040 , 0.7698664462986164 ) ]
141+ [ InlineData ( jpgSecond , pngSecond , 873399 , 221697 , 0.7387339055793991 ) ]
142+ public void SimilarImagesAreCompressedDifferent ( string first , string second , int expAbsError , int expPixError , double expPixPercent )
119143 {
120144 using var firstImage = SKImage . FromEncodedData ( GetImagePath ( first ) ) ;
121145 using var secondImage = SKImage . FromEncodedData ( GetImagePath ( second ) ) ;
0 commit comments