Skip to content

Commit 78d6d08

Browse files
committed
feat: cleaning
1 parent a5db344 commit 78d6d08

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

Tests/SnapshotTestingTests/ImageSerializationPluginTests.swift

+17-19
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#if canImport(SwiftUI) && canImport(ObjectiveC)
21
import XCTest
32
import SnapshotTestingPlugin
43
@testable import SnapshotTesting
@@ -10,26 +9,26 @@ import UIKit
109
import AppKit
1110
#endif
1211

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 {
2013

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() {}
2430
}
2531

26-
// MARK: - SnapshotTestingPlugin
27-
static var identifier: String = "ImageSerializationPlugin.MockImageSerializationPlugin.mock"
28-
required init() {}
29-
}
30-
31-
class ImageSerializerTests: XCTestCase {
32-
3332
var imageSerializer: ImageSerializer!
3433
// #E48900FF
3534
var _1pxOrangePNGImage = Data(base64Encoded: "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAAaADAAQAAAABAAAAAQAAAAD5Ip3+AAAADUlEQVQIHWN40snwHwAGLwJteELaggAAAABJRU5ErkJggg==")!
@@ -117,4 +116,3 @@ class ImageSerializerTests: XCTestCase {
117116
XCTAssertEqual(type(of: plugins[0]).imageFormat.rawValue, "mock", "The first plugin should support the 'mock' format.")
118117
}
119118
}
120-
#endif

0 commit comments

Comments
 (0)