@@ -46,7 +46,6 @@ class IterableAPIResponseTests: XCTestCase {
46
46
47
47
func testResponseCode200WithNoData( ) {
48
48
let xpectation = expectation ( description: " no data " )
49
- let networkSession = MockNetworkSession ( statusCode: 200 , data: nil )
50
49
let iterableRequest = IterableRequest . post ( PostRequest ( path: " " , args: nil , body: [ : ] ) )
51
50
52
51
createApiClient ( networkSession: MockNetworkSession ( statusCode: 200 , data: nil ) )
@@ -61,7 +60,6 @@ class IterableAPIResponseTests: XCTestCase {
61
60
func testResponseCode200WithInvalidJson( ) {
62
61
let xpectation = expectation ( description: " invalid json " )
63
62
let data = " {'''}} " . data ( using: . utf8) !
64
- let networkSession = MockNetworkSession ( statusCode: 200 , data: data)
65
63
let iterableRequest = IterableRequest . post ( PostRequest ( path: " " , args: nil , body: [ : ] ) )
66
64
67
65
createApiClient ( networkSession: MockNetworkSession ( statusCode: 200 , data: data) )
@@ -75,7 +73,6 @@ class IterableAPIResponseTests: XCTestCase {
75
73
76
74
func testResponseCode400WithoutMessage( ) { // 400 = bad reqeust
77
75
let xpectation = expectation ( description: " 400 without message " )
78
- let networkSession = MockNetworkSession ( statusCode: 400 )
79
76
let iterableRequest = IterableRequest . post ( PostRequest ( path: " " , args: nil , body: [ : ] ) )
80
77
81
78
createApiClient ( networkSession: MockNetworkSession ( statusCode: 400 ) )
@@ -89,7 +86,6 @@ class IterableAPIResponseTests: XCTestCase {
89
86
90
87
func testResponseCode400WitMessage( ) {
91
88
let xpectation = expectation ( description: " 400 with message " )
92
- let networkSession = MockNetworkSession ( statusCode: 400 , json: [ " msg " : " Test error " ] )
93
89
let iterableRequest = IterableRequest . post ( PostRequest ( path: " " , args: nil , body: [ : ] ) )
94
90
95
91
createApiClient ( networkSession: MockNetworkSession ( statusCode: 400 , json: [ " msg " : " Test error " ] ) )
@@ -103,7 +99,6 @@ class IterableAPIResponseTests: XCTestCase {
103
99
104
100
func testResponseCode401( ) { // 401 = unauthorized
105
101
let xpectation = expectation ( description: " 401 " )
106
- let networkSession = MockNetworkSession ( statusCode: 401 )
107
102
let iterableRequest = IterableRequest . post ( PostRequest ( path: " " , args: nil , body: [ : ] ) )
108
103
109
104
createApiClient ( networkSession: MockNetworkSession ( statusCode: 401 ) )
@@ -117,7 +112,6 @@ class IterableAPIResponseTests: XCTestCase {
117
112
118
113
func testResponseCode500( ) { // 500 = internal server error
119
114
let xpectation = expectation ( description: " 500 " )
120
- let networkSession = MockNetworkSession ( statusCode: 500 )
121
115
let iterableRequest = IterableRequest . post ( PostRequest ( path: " " , args: nil , body: [ : ] ) )
122
116
123
117
createApiClient ( networkSession: MockNetworkSession ( statusCode: 500 ) )
@@ -131,7 +125,6 @@ class IterableAPIResponseTests: XCTestCase {
131
125
132
126
func testNon200ResponseCode( ) { // 302 = redirection
133
127
let xpectation = expectation ( description: " non 200 " )
134
- let networkSession = MockNetworkSession ( statusCode: 302 )
135
128
let iterableRequest = IterableRequest . post ( PostRequest ( path: " " , args: nil , body: [ : ] ) )
136
129
137
130
createApiClient ( networkSession: MockNetworkSession ( statusCode: 302 ) )
@@ -145,7 +138,6 @@ class IterableAPIResponseTests: XCTestCase {
145
138
146
139
func testNoNetworkResponse( ) {
147
140
let xpectation = expectation ( description: " no network response " )
148
- let networkSession = NoNetworkNetworkSession ( )
149
141
let iterableRequest = IterableRequest . post ( PostRequest ( path: " " , args: nil , body: [ : ] ) )
150
142
151
143
createApiClient ( networkSession: NoNetworkNetworkSession ( ) )
0 commit comments