-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from iZettle/TextStyle_Equatable_BugFix
TextStyle Equatable bug fix
- Loading branch information
Showing
3 changed files
with
36 additions
and
1 deletion.
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
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,26 @@ | ||
// | ||
// TextStyleTests.swift | ||
// FormTests | ||
// | ||
// Created by Mayur Deshmukh on 12/02/19. | ||
// Copyright © 2019 iZettle. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
import Form | ||
|
||
class TextStyleTests: XCTestCase { | ||
|
||
func testTextStyleEquality() { | ||
let textStyle1 = TextStyle(font: .systemFont(ofSize: 14.0), color: .red, alignment: .left, lineBreakMode: .byWordWrapping) | ||
let textStyle2 = TextStyle(font: .systemFont(ofSize: 14.0), color: .red, alignment: .left, lineBreakMode: .byWordWrapping) | ||
let textStyle3 = TextStyle(font: .systemFont(ofSize: 14.0), color: .red, alignment: .left, lineBreakMode: .byCharWrapping) | ||
let textStyle4 = TextStyle(font: .systemFont(ofSize: 15.0), color: .red, alignment: .left, lineBreakMode: .byWordWrapping) | ||
let textStyle5 = TextStyle(font: .systemFont(ofSize: 14.0), color: .green, alignment: .left, lineBreakMode: .byWordWrapping) | ||
|
||
XCTAssertEqual(textStyle1, textStyle2) | ||
XCTAssertNotEqual(textStyle1, textStyle3) | ||
XCTAssertNotEqual(textStyle1, textStyle4) | ||
XCTAssertNotEqual(textStyle1, textStyle5) | ||
} | ||
} |