@@ -12,24 +12,25 @@ import XCTest
12
12
@testable import Freetime
13
13
class BookmarkViewModelTests : XCTestCase {
14
14
15
- var issue : Bookmark !
16
- var other : Bookmark !
15
+ var bookmark : Bookmark !
16
+ var bookmarkViewModel : BookmarkViewModel !
17
17
18
- var issueModel : BookmarkViewModel !
19
- var otherModel : BookmarkViewModel !
20
-
21
- override func setUp( ) {
22
- super. setUp ( )
23
-
24
- issue = Bookmark ( type: . issue, name: " IGListKit on Bookmarks " , owner: " rizwankce " , title: " Bookmarks view controller not using IGLK " )
25
- issueModel = BookmarkViewModel ( bookmark: issue, contentSizeCategory: . large, width: 0 )
18
+ func test_bookmarkText_issue( ) {
19
+ bookmark = Bookmark ( type: . issue, name: " IGListKit on Bookmarks " , owner: " rizwankce " , title: " Bookmarks view controller not using IGLK " )
20
+ bookmarkViewModel = BookmarkViewModel ( bookmark: bookmark, contentSizeCategory: . large, width: 0 )
21
+ XCTAssertEqual ( bookmark. title, bookmarkViewModel. text. string. allText)
22
+ }
26
23
27
- other = Bookmark ( type: . commit, name: " Implemented Bookmark ViewModel " , owner: " heshamsalman " )
28
- otherModel = BookmarkViewModel ( bookmark: other, contentSizeCategory: . large, width: 0 )
24
+ func test_bookmarkText_pullRequest( ) {
25
+ bookmark = Bookmark ( type: . pullRequest, name: " Implemented Bookmark ViewModel " , owner: " heshamsalman " )
26
+ bookmarkViewModel = BookmarkViewModel ( bookmark: bookmark, contentSizeCategory: . large, width: 0 )
27
+ XCTAssertEqual ( bookmark. title, bookmarkViewModel. text. string. allText)
29
28
}
30
29
31
- func test_bookmarkText_other( ) {
32
- XCTAssertEqual ( " \( other. owner) / \( other. name) " , otherModel. text. string. allText)
30
+ func test_bookmarkText_repository( ) {
31
+ bookmark = Bookmark ( type: . repo, name: " GitHawk " , owner: " GitHawkApp " )
32
+ bookmarkViewModel = BookmarkViewModel ( bookmark: bookmark, contentSizeCategory: . large, width: 0 )
33
+ XCTAssertEqual ( " \( bookmark. owner) / \( bookmark. name) " , bookmarkViewModel. text. string. allText)
33
34
}
34
35
35
36
}
0 commit comments