1
- #if canImport(SwiftUI) && canImport(ObjectiveC)
2
1
import XCTest
3
2
import SnapshotTestingPlugin
4
3
@testable import SnapshotTesting
@@ -10,26 +9,26 @@ import UIKit
10
9
import AppKit
11
10
#endif
12
11
13
- class MockImageSerializationPlugin : ImageSerializationPlugin {
14
-
15
- static var imageFormat : ImageSerializationFormat = . plugins( " mock " )
16
-
17
- func encodeImage( _ image: SnapImage ) -> Data ? {
18
- return " mockImageData " . data ( using: . utf8)
19
- }
12
+ class ImageSerializerTests : XCTestCase {
20
13
21
- func decodeImage( _ data: Data ) -> SnapImage ? {
22
- let mockImage = SnapImage ( )
23
- return mockImage
14
+ class MockImageSerializationPlugin : ImageSerializationPlugin {
15
+
16
+ static var imageFormat : ImageSerializationFormat = . plugins( " mock " )
17
+
18
+ func encodeImage( _ image: SnapImage ) -> Data ? {
19
+ return " mockImageData " . data ( using: . utf8)
20
+ }
21
+
22
+ func decodeImage( _ data: Data ) -> SnapImage ? {
23
+ let mockImage = SnapImage ( )
24
+ return mockImage
25
+ }
26
+
27
+ // MARK: - SnapshotTestingPlugin
28
+ static var identifier : String = " ImageSerializationPlugin.MockImageSerializationPlugin.mock "
29
+ required init ( ) { }
24
30
}
25
31
26
- // MARK: - SnapshotTestingPlugin
27
- static var identifier : String = " ImageSerializationPlugin.MockImageSerializationPlugin.mock "
28
- required init ( ) { }
29
- }
30
-
31
- class ImageSerializerTests : XCTestCase {
32
-
33
32
var imageSerializer : ImageSerializer !
34
33
// #E48900FF
35
34
var _1pxOrangePNGImage = Data ( base64Encoded: " iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAAaADAAQAAAABAAAAAQAAAAD5Ip3+AAAADUlEQVQIHWN40snwHwAGLwJteELaggAAAABJRU5ErkJggg== " ) !
@@ -117,4 +116,3 @@ class ImageSerializerTests: XCTestCase {
117
116
XCTAssertEqual ( type ( of: plugins [ 0 ] ) . imageFormat. rawValue, " mock " , " The first plugin should support the 'mock' format. " )
118
117
}
119
118
}
120
- #endif
0 commit comments