-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFilmsTests.swift
40 lines (31 loc) · 971 Bytes
/
FilmsTests.swift
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
//
// FilmsTests.swift
// SwapiSwiftTests
//
// Created by Joe Bramhall on 12/31/19.
// Copyright © 2019 thinx. All rights reserved.
//
import XCTest
@testable import SwapiSwift
class FilmsTests: XCTestCase {
var sut: ResourceRoot<Film>?
override func setUp() {
sut = sampleFilms
}
override func tearDown() {
sut = nil
}
func testFilmsResource() {
XCTAssertEqual(sut?.count, 7)
XCTAssertNil(sut?.next)
XCTAssertNil(sut?.previous)
XCTAssertEqual(sut?.results.count, 7)
XCTAssertEqual(sut?.results[0].title, "A New Hope")
XCTAssertEqual(sut?.results[1].title, "Attack of the Clones")
XCTAssertEqual(sut?.results[2].title, "The Phantom Menace")
XCTAssertEqual(sut?.results[3].title, "Revenge of the Sith")
XCTAssertEqual(sut?.results[4].title, "Return of the Jedi")
XCTAssertEqual(sut?.results[5].title, "The Empire Strikes Back")
XCTAssertEqual(sut?.results[6].title, "The Force Awakens")
}
}