Repository navigation
Expand file tree
/
Copy pathExampleTests.swift
More file actions
49 lines (38 loc) · 1.57 KB
/
Copy pathExampleTests.swift
File metadata and controls
49 lines (38 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//
// ExampleTests.swift
// ExampleTests
//
// Created by Davide Mendolia on 25/11/15.
// Copyright © 2015 GoKarumi S.L. All rights reserved.
//
import XCTest
import Nimble
import BothamUI
@testable import Example
class ExampleTests: XCTestCase {
func testShowListOfSeries() {
let expectation = expectationWithDescription("Covers will be shown")
let fakeSeriesUI = FakeSeriesUI(expectation: expectation)
let presenter = SeriesPresenter(ui: fakeSeriesUI, wireframe: FakeSeriesWireframe())
presenter.viewDidLoad()
waitForExpectationsWithTimeout(10, handler: nil)
expect(fakeSeriesUI.loaderWasShowed).to(beTrue())
expect(fakeSeriesUI.itemsShowed.count).toOneDay(equal(17))
expect(fakeSeriesUI.loaderWasHided).toOneDay(beTrue())
}
func testResfreshTableOfCharacters() {
let fakeCharactersUI = FakeCharactersUI()
let presenter = CharactersPresenter(ui: fakeCharactersUI, wireframe: CharactersWireframe())
presenter.didStartRefreshing()
expect(fakeCharactersUI.itemsShowed.count).to(equal(11))
expect(fakeCharactersUI.didRefresh).to(beTrue())
}
func testPresentCharacterDetailFromCharacterList() {
let fakeSeriesUI = FakeSeriesUI()
let fakeSeriesWireframe = FakeSeriesWireframe()
let presenter = SeriesPresenter(ui: fakeSeriesUI, wireframe: fakeSeriesWireframe)
let series = Series(name: "IronMan")
presenter.itemWasTapped(series)
expect(fakeSeriesWireframe.seriesDetailViewControllerWasPresented).to(beTrue())
}
}