From fd693f6d4df30ae12bda6b4fd51ee18563c73fb4 Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 27 Dec 2018 17:49:05 +0800 Subject: [PATCH] Fix tests --- Sources/PlaceholderKit/PlaceholderKit.swift | 12 ++++++------ .../PlaceholderFactoryTests.swift | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Sources/PlaceholderKit/PlaceholderKit.swift b/Sources/PlaceholderKit/PlaceholderKit.swift index e2d5641..8460957 100644 --- a/Sources/PlaceholderKit/PlaceholderKit.swift +++ b/Sources/PlaceholderKit/PlaceholderKit.swift @@ -21,11 +21,11 @@ public typealias Font = UIFont public struct PlaceholderKit { public static let defaultPalette = ColorPalette(name: "defaultPalette", colors: [ - UIColor("ff5a5a"), - UIColor("ff7b5a"), - UIColor("ffb65a"), - UIColor("ced07d"), - UIColor("7dd0b6") + Color("ff5a5a"), + Color("ff7b5a"), + Color("ffb65a"), + Color("ced07d"), + Color("7dd0b6") ]) public static let defaultSizes = [ @@ -42,7 +42,7 @@ public struct PlaceholderKit { sizes: defaultSizes) } - public static var defaultPlaceholders: [UIImage] { + public static var defaultPlaceholders: [Image] { return defaultPreset.placeholders.compactMap({$0.render()}) } } diff --git a/Tests/PlaceholderKitTests/PlaceholderFactoryTests.swift b/Tests/PlaceholderKitTests/PlaceholderFactoryTests.swift index bc445d7..999ddc0 100644 --- a/Tests/PlaceholderKitTests/PlaceholderFactoryTests.swift +++ b/Tests/PlaceholderKitTests/PlaceholderFactoryTests.swift @@ -13,7 +13,7 @@ class PlaceholderTests: XCTestCase { func testSolidColor() { // Given a valid setting let outputSize = CGSize(width: 1600, height: 900) - let image = PlaceholderBuilder().coloredBackground(color: .red, size: outputSize) + let image = Placeholder(size: outputSize, backgroundStyle: .solidColor(.red)).render() // output should not be nil XCTAssertNotNil(image)