diff --git a/Form.xcodeproj/project.pbxproj b/Form.xcodeproj/project.pbxproj index 8c1c453..7974a72 100644 --- a/Form.xcodeproj/project.pbxproj +++ b/Form.xcodeproj/project.pbxproj @@ -35,6 +35,7 @@ CA6755EA1D4B6F1C000662FF /* SegmentedControlStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA6755E91D4B6F1C000662FF /* SegmentedControlStyle.swift */; }; CD49499B1C199520000176D3 /* (null) in Sources */ = {isa = PBXBuildFile; }; CDD2A5211F42DE7500E2B78B /* HighlightedTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDD2A5201F42DE7500E2B78B /* HighlightedTests.swift */; }; + CFD2FFE3221323BF002D4D36 /* TextStyleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CFD2FFE2221323BF002D4D36 /* TextStyleTests.swift */; }; E63D89BF1DF59D6100AAB381 /* DisplayableString.swift in Sources */ = {isa = PBXBuildFile; fileRef = E63D89BE1DF59D6100AAB381 /* DisplayableString.swift */; }; F60102311DAE2D410020015B /* TableChange.swift in Sources */ = {isa = PBXBuildFile; fileRef = F60102301DAE2D410020015B /* TableChange.swift */; }; F604260A20B6A47E00BC4CAB /* ParentChildRelationalTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F604260920B6A47E00BC4CAB /* ParentChildRelationalTests.swift */; }; @@ -139,6 +140,7 @@ B35F8B4B1F3783E400904E37 /* CollectionDiffTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollectionDiffTests.swift; sourceTree = ""; }; CA6755E91D4B6F1C000662FF /* SegmentedControlStyle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SegmentedControlStyle.swift; path = Form/SegmentedControlStyle.swift; sourceTree = ""; }; CDD2A5201F42DE7500E2B78B /* HighlightedTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HighlightedTests.swift; sourceTree = ""; }; + CFD2FFE2221323BF002D4D36 /* TextStyleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextStyleTests.swift; sourceTree = ""; }; E63D89BE1DF59D6100AAB381 /* DisplayableString.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DisplayableString.swift; path = Form/DisplayableString.swift; sourceTree = SOURCE_ROOT; }; F60102301DAE2D410020015B /* TableChange.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TableChange.swift; path = Form/TableChange.swift; sourceTree = ""; }; F604260920B6A47E00BC4CAB /* ParentChildRelationalTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParentChildRelationalTests.swift; sourceTree = ""; }; @@ -263,6 +265,7 @@ F62E45B51CABFB5300C6867E /* FormTests */ = { isa = PBXGroup; children = ( + CFD2FFE2221323BF002D4D36 /* TextStyleTests.swift */, CDD2A5201F42DE7500E2B78B /* HighlightedTests.swift */, 1C2881821F20EE2000666A21 /* SelectViewTests.swift */, 1CDD56A91D9C10D7004B0CA9 /* TableTests.swift */, @@ -572,6 +575,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + CFD2FFE3221323BF002D4D36 /* TextStyleTests.swift in Sources */, F604260A20B6A47E00BC4CAB /* ParentChildRelationalTests.swift in Sources */, F6B81B9420CA906000B6AC39 /* NumberEditorTests.swift in Sources */, CDD2A5211F42DE7500E2B78B /* HighlightedTests.swift in Sources */, diff --git a/FormTests/TextStyleTests.swift b/FormTests/TextStyleTests.swift new file mode 100644 index 0000000..ff11c49 --- /dev/null +++ b/FormTests/TextStyleTests.swift @@ -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) + } +}