Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit b61324b

Browse files
committed
Update tests
1 parent 1a795e0 commit b61324b

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

FreetimeTests/Bookmark Tests/BookmarkViewModelTests.swift

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,25 @@ import XCTest
1212
@testable import Freetime
1313
class BookmarkViewModelTests: XCTestCase {
1414

15-
var issue: Bookmark!
16-
var other: Bookmark!
15+
var bookmark: Bookmark!
16+
var bookmarkViewModel: BookmarkViewModel!
1717

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+
}
2623

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)
2928
}
3029

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)
3334
}
3435

3536
}

0 commit comments

Comments
 (0)