Fix tests

This commit is contained in:
Simon 2018-12-27 17:49:05 +08:00
parent f2d63cbc6d
commit fd693f6d4d
2 changed files with 7 additions and 7 deletions

View File

@ -21,11 +21,11 @@ public typealias Font = UIFont
public struct PlaceholderKit { public struct PlaceholderKit {
public static let defaultPalette = ColorPalette(name: "defaultPalette", public static let defaultPalette = ColorPalette(name: "defaultPalette",
colors: [ colors: [
UIColor("ff5a5a"), Color("ff5a5a"),
UIColor("ff7b5a"), Color("ff7b5a"),
UIColor("ffb65a"), Color("ffb65a"),
UIColor("ced07d"), Color("ced07d"),
UIColor("7dd0b6") Color("7dd0b6")
]) ])
public static let defaultSizes = [ public static let defaultSizes = [
@ -42,7 +42,7 @@ public struct PlaceholderKit {
sizes: defaultSizes) sizes: defaultSizes)
} }
public static var defaultPlaceholders: [UIImage] { public static var defaultPlaceholders: [Image] {
return defaultPreset.placeholders.compactMap({$0.render()}) return defaultPreset.placeholders.compactMap({$0.render()})
} }
} }

View File

@ -13,7 +13,7 @@ class PlaceholderTests: XCTestCase {
func testSolidColor() { func testSolidColor() {
// Given a valid setting // Given a valid setting
let outputSize = CGSize(width: 1600, height: 900) 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 // output should not be nil
XCTAssertNotNil(image) XCTAssertNotNil(image)