-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
59 additions
and
330 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// | ||
// LabelConfigTests.swift | ||
// MobilePlayer | ||
// | ||
// Created by Baris Sencan on 08/10/2015. | ||
// Copyright © 2015 MovieLaLa. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import XCTest | ||
@testable import MobilePlayer | ||
|
||
private let defaultText: String? = nil | ||
private let text = "lorem ipsum" | ||
|
||
private let font = "Baskerville" | ||
|
||
private let defaultSize = CGFloat(14) | ||
private let size = CGFloat(22) | ||
|
||
private let defaultColor = UIColor.whiteColor() | ||
private let colorString = "#fffffff0" | ||
private let color = UIColor(red: 1, green: 1, blue: 1, alpha: 240 / 255) | ||
|
||
class LabelConfigTests: XCTestCase { | ||
let defaultLabelConfig = LabelConfig() | ||
let labelConfig = LabelConfig(dictionary: [ | ||
"text": text, | ||
"font": font, | ||
"size": size, | ||
"textColor": colorString]) | ||
|
||
func testText() { | ||
XCTAssert(defaultLabelConfig.text == defaultText, "default text is wrong") | ||
XCTAssert(labelConfig.text == text, "failed to set text") | ||
} | ||
|
||
func testFont() { | ||
XCTAssert(defaultLabelConfig.font == UIFont.systemFontOfSize(defaultSize), "default font is wrong") | ||
XCTAssert(labelConfig.font == UIFont(name: font, size: size), "failed to set font") | ||
} | ||
|
||
func testTextColor() { | ||
XCTAssert(defaultLabelConfig.textColor == defaultColor, "default text color is wrong") | ||
XCTAssert(labelConfig.textColor == color, "failed to set text color") | ||
} | ||
} |
Oops, something went wrong.