-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default values for line break mode and alignment #16
Conversation
//When | ||
let copy = attributes.copy() | ||
//Then | ||
XCTAssertEqual(copy, attributes, "Copy is not equal to line attributes") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Copy is not equal to line attributes"
NOT equal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so, this message contains a description what was wrong in this assertion
|
||
//Then | ||
XCTAssertEqual(style.font, .systemFont(ofSize: 12), "Default style font must be equal to system font of 12 size") | ||
XCTAssertEqual(style.color, .black, "Default color must be equal to nil") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XCTAssertEqual(style.color, .black, "Default color must be equal to nil") | |
XCTAssertEqual(style.color, .black, "Default color must be equal to black") |
//Then | ||
XCTAssertEqual(style.font, .systemFont(ofSize: 12), "Default style font must be equal to system font of 12 size") | ||
XCTAssertEqual(style.color, .black, "Default color must be equal to nil") | ||
XCTAssertEqual(style.backgroundColor, .clear, "Default backgroundColor must be equal to nil") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XCTAssertEqual(style.backgroundColor, .clear, "Default backgroundColor must be equal to nil") | |
XCTAssertEqual(style.backgroundColor, .clear, "Default backgroundColor must be equal to clear") |
XCTAssertEqual(style.font, .systemFont(ofSize: 12), "Default style font must be equal to system font of 12 size") | ||
XCTAssertEqual(style.color, .black, "Default color must be equal to nil") | ||
XCTAssertEqual(style.backgroundColor, .clear, "Default backgroundColor must be equal to nil") | ||
XCTAssertEqual(style.ligature, nil, "Default ligature must be equal to nil") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XCTAssertEqual(style.ligature, nil, "Default ligature must be equal to nil") | |
XCTAssertNil(style.ligature, "Default ligature must be equal to nil") |
XCTAssertEqual(style.kerning, nil, "Default kerning must be equal to nil") | ||
XCTAssertEqual(style.strokeWidth, nil, "Default strokeWidth must be equal to nil") | ||
XCTAssertEqual(style.shadowStyle, nil, "Default shadowStyle must be equal to nil") | ||
XCTAssertEqual(style.effectStyle, nil, "Default effectStyle must be equal to nil") | ||
XCTAssertEqual(style.baselineOffset, nil, "Default baselineOffset must be equal to nil") | ||
XCTAssertEqual(style.obliqueness, nil, "Default obliqueness must be equal to nil") | ||
XCTAssertEqual(style.expansion, nil, "Default expansion must be equal to nil") | ||
XCTAssertEqual(style.strikeThroughLine, nil, "Default strikeThroughLine must be equal to nil") | ||
XCTAssertEqual(style.underlineLine, nil, "Default underlineLine must be equal to nil") | ||
XCTAssertEqual(style.strokeColor, nil, "Default strokeColor must be equal to nil") | ||
XCTAssertEqual(style.attachment, nil, "Default attachment must be equal to nil") | ||
XCTAssertEqual(style.link, nil, "Default link must be equal to nil") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you can also replace XCTAssertEqual
to XCTAssertNil
XCTAssertEqual(style.lineSpacing, nil, "Default lineSpacing must be equal to nil") | ||
XCTAssertEqual(style.paragraphSpacing, nil, "Default paragraphSpacing must be equal to nil") | ||
XCTAssertEqual(style.paragraphSpacingBefore, nil, "Default paragraphSpacingBefore must be equal to nil") | ||
XCTAssertEqual(style.lineHeight, nil, "Default lineHeight must be equal to nil") | ||
XCTAssertEqual(style.paragraphStyle, nil, "Default paragraphStyle must be equal to nil") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here
//When | ||
let copy = attributes.copy() | ||
//Then | ||
XCTAssertEqual(copy, attributes, "Copy is not equal to line attributes") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so, this message contains a description what was wrong in this assertion
By default
UILabel
uses.natural
text alignment and.byTruncatingTail
line break mode. To leave default behaviour as is I added these default values to all styles. Related to #13