44// See LICENSE file for license
55//
66
7- import XCTest
87@testable import Markup
8+ import XCTest
99
1010class MarkupRendererTests : XCTestCase {
1111 let baseFont = Font . systemFont ( ofSize: 16 )
1212 var sut : MarkupRenderer !
13-
13+
1414 override func setUp( ) {
1515 super. setUp ( )
1616 sut = MarkupRenderer ( baseFont: baseFont)
1717 }
18-
18+
1919 func testPlainText_render_rendersPlainText( ) {
2020 // given
2121 let input = " hello there "
2222 let expected = NSAttributedString ( string: " hello there " ,
23- attributes: [ NSAttributedString . Key. font: baseFont] )
24-
23+ attributes: [ NSAttributedString . Key. font: baseFont] )
24+
2525 // when
2626 let result = sut. render ( text: input)
27-
27+
2828 // then
2929 XCTAssertEqual ( result, expected)
3030 }
31-
31+
3232 func testStrongText_render_rendersBoldText( ) {
3333 // given
3434 let input = " hello *there* "
3535 let boldFont = baseFont. boldFont ( ) !
3636 let expected = [
3737 NSAttributedString ( string: " hello " ,
38- attributes: [ NSAttributedString . Key. font: baseFont] ) ,
38+ attributes: [ NSAttributedString . Key. font: baseFont] ) ,
3939 NSAttributedString ( string: " there " ,
40- attributes: [ NSAttributedString . Key. font: boldFont] )
41- ] . joined ( )
40+ attributes: [ NSAttributedString . Key. font: boldFont] )
41+ ] . joined ( )
4242
4343 // when
4444 let result = sut. render ( text: input)
@@ -53,10 +53,10 @@ class MarkupRendererTests: XCTestCase {
5353 let italicFont = baseFont. italicFont ( ) !
5454 let expected = [
5555 NSAttributedString ( string: " hello " ,
56- attributes: [ NSAttributedString . Key. font: baseFont] ) ,
56+ attributes: [ NSAttributedString . Key. font: baseFont] ) ,
5757 NSAttributedString ( string: " there " ,
58- attributes: [ NSAttributedString . Key. font: italicFont] )
59- ] . joined ( )
58+ attributes: [ NSAttributedString . Key. font: italicFont] )
59+ ] . joined ( )
6060
6161 // when
6262 let result = sut. render ( text: input)
@@ -75,10 +75,10 @@ class MarkupRendererTests: XCTestCase {
7575 ]
7676 let expected = [
7777 NSAttributedString ( string: " hello " ,
78- attributes: [ NSAttributedString . Key. font: baseFont] ) ,
78+ attributes: [ NSAttributedString . Key. font: baseFont] ) ,
7979 NSAttributedString ( string: " there " ,
80- attributes: strikethroughAttributes)
81- ] . joined ( )
80+ attributes: strikethroughAttributes)
81+ ] . joined ( )
8282
8383 // when
8484 let result = sut. render ( text: input)
@@ -93,14 +93,14 @@ class MarkupRendererTests: XCTestCase {
9393 let boldItalicFont = baseFont. boldFont ( ) !. italicFont ( ) !
9494 let expected = [
9595 NSAttributedString ( string: " hello " ,
96- attributes: [ NSAttributedString . Key. font: baseFont] ) ,
96+ attributes: [ NSAttributedString . Key. font: baseFont] ) ,
9797 NSAttributedString ( string: " there " ,
98- attributes: [ NSAttributedString . Key. font: boldItalicFont] ) ,
98+ attributes: [ NSAttributedString . Key. font: boldItalicFont] ) ,
9999 NSAttributedString ( string: " " ,
100- attributes: [ NSAttributedString . Key. font: baseFont] ) ,
100+ attributes: [ NSAttributedString . Key. font: baseFont] ) ,
101101 NSAttributedString ( string: " there " ,
102- attributes: [ NSAttributedString . Key. font: boldItalicFont] )
103- ] . joined ( )
102+ attributes: [ NSAttributedString . Key. font: boldItalicFont] )
103+ ] . joined ( )
104104
105105 // when
106106 let result = sut. render ( text: input)
0 commit comments