Created
August 9, 2018 03:35
-
-
Save keehun/054a6968890dd18dc67ff20ce383c41b to your computer and use it in GitHub Desktop.
Practical Dynamic Type, Part 2
This file contains hidden or 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
| import XCTest | |
| @testable import PracticalDynamicTypePart2 | |
| class PracticalDynamicTypePart2Tests: XCTestCase { | |
| var subject: Hal9000! | |
| override func setUp() { | |
| super.setUp() | |
| subject = Hal9000() | |
| } | |
| func testDynamicType() { | |
| /// pointSize = 31 | |
| FontMetrics.default.sizeCategory = .extraSmall | |
| let smallSize = subject.dialog.font.pointSize | |
| /// pointSize = 36 | |
| FontMetrics.default.sizeCategory = .large | |
| let defaultSize = subject.dialog.font.pointSize | |
| /// pointSize = 101 | |
| FontMetrics.default.sizeCategory = .accessibilityExtraExtraExtraLarge | |
| let xxxlSize = subject.dialog.font.pointSize | |
| XCTAssertGreaterThan(defaultSize, smallSize) | |
| XCTAssertGreaterThan(xxxlSize, defaultSize) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment