Skip to content

Commit

Permalink
feat: cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
mackoj committed Sep 16, 2024
1 parent a5db344 commit 78d6d08
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions Tests/SnapshotTestingTests/ImageSerializationPluginTests.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#if canImport(SwiftUI) && canImport(ObjectiveC)
import XCTest
import SnapshotTestingPlugin
@testable import SnapshotTesting
Expand All @@ -10,26 +9,26 @@ import UIKit
import AppKit
#endif

class MockImageSerializationPlugin: ImageSerializationPlugin {

static var imageFormat: ImageSerializationFormat = .plugins("mock")

func encodeImage(_ image: SnapImage) -> Data? {
return "mockImageData".data(using: .utf8)
}
class ImageSerializerTests: XCTestCase {

func decodeImage(_ data: Data) -> SnapImage? {
let mockImage = SnapImage()
return mockImage
class MockImageSerializationPlugin: ImageSerializationPlugin {

static var imageFormat: ImageSerializationFormat = .plugins("mock")

func encodeImage(_ image: SnapImage) -> Data? {
return "mockImageData".data(using: .utf8)
}

func decodeImage(_ data: Data) -> SnapImage? {
let mockImage = SnapImage()
return mockImage
}

// MARK: - SnapshotTestingPlugin
static var identifier: String = "ImageSerializationPlugin.MockImageSerializationPlugin.mock"
required init() {}
}

// MARK: - SnapshotTestingPlugin
static var identifier: String = "ImageSerializationPlugin.MockImageSerializationPlugin.mock"
required init() {}
}

class ImageSerializerTests: XCTestCase {

var imageSerializer: ImageSerializer!
// #E48900FF
var _1pxOrangePNGImage = Data(base64Encoded: "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAAaADAAQAAAABAAAAAQAAAAD5Ip3+AAAADUlEQVQIHWN40snwHwAGLwJteELaggAAAABJRU5ErkJggg==")!
Expand Down Expand Up @@ -117,4 +116,3 @@ class ImageSerializerTests: XCTestCase {
XCTAssertEqual(type(of: plugins[0]).imageFormat.rawValue, "mock", "The first plugin should support the 'mock' format.")
}
}
#endif

0 comments on commit 78d6d08

Please sign in to comment.