-
Notifications
You must be signed in to change notification settings - Fork 8
/
Issue4Test.swift
66 lines (51 loc) · 1.73 KB
/
Issue4Test.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//
// Issue4Test.swift
// AlamofireXmlToObjects
//
// Created by Edwin Vermeer on 8/4/16.
// Copyright © 2016 evict. All rights reserved.
//
import XCTest
import Alamofire
import XMLDictionary
import EVReflection
class XmlResponse: EVObject {
var qlist: [QList]?
}
class QList: EVObject {
var piname: String?
var picell: String?
var rinum: String?
}
class Issue4Test: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
EVReflection.setBundleIdentifier(JDBOR.self)
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testIssue() {
// This is an example of a functional test case.
let URL: URLConvertible = "https://raw.githubusercontent.com/evermeer/AlamofireXmlToObjects/master/AlamofireXmlToObjectsTests/Issue4_xml"
let expectation = self.expectation(description: "\(URL)")
Alamofire.request(URL)
.responseObject { (response: DataResponse<XmlResponse>) in
if let error = response.result.error {
XCTAssert(false, "ERROR: \(error.localizedDescription)")
} else {
if let result = response.result.value {
print("\(result.description)")
} else {
XCTAssert(false, "no result from service")
}
}
expectation.fulfill()
}
waitForExpectations(timeout: 10) { error in
XCTAssertNil(error, "\(error)")
}
}
}