@@ -46,7 +46,6 @@ class IterableAPIResponseTests: XCTestCase {
4646
4747 func testResponseCode200WithNoData( ) {
4848 let xpectation = expectation ( description: " no data " )
49- let networkSession = MockNetworkSession ( statusCode: 200 , data: nil )
5049 let iterableRequest = IterableRequest . post ( PostRequest ( path: " " , args: nil , body: [ : ] ) )
5150
5251 createApiClient ( networkSession: MockNetworkSession ( statusCode: 200 , data: nil ) )
@@ -61,7 +60,6 @@ class IterableAPIResponseTests: XCTestCase {
6160 func testResponseCode200WithInvalidJson( ) {
6261 let xpectation = expectation ( description: " invalid json " )
6362 let data = " {'''}} " . data ( using: . utf8) !
64- let networkSession = MockNetworkSession ( statusCode: 200 , data: data)
6563 let iterableRequest = IterableRequest . post ( PostRequest ( path: " " , args: nil , body: [ : ] ) )
6664
6765 createApiClient ( networkSession: MockNetworkSession ( statusCode: 200 , data: data) )
@@ -75,7 +73,6 @@ class IterableAPIResponseTests: XCTestCase {
7573
7674 func testResponseCode400WithoutMessage( ) { // 400 = bad reqeust
7775 let xpectation = expectation ( description: " 400 without message " )
78- let networkSession = MockNetworkSession ( statusCode: 400 )
7976 let iterableRequest = IterableRequest . post ( PostRequest ( path: " " , args: nil , body: [ : ] ) )
8077
8178 createApiClient ( networkSession: MockNetworkSession ( statusCode: 400 ) )
@@ -89,7 +86,6 @@ class IterableAPIResponseTests: XCTestCase {
8986
9087 func testResponseCode400WitMessage( ) {
9188 let xpectation = expectation ( description: " 400 with message " )
92- let networkSession = MockNetworkSession ( statusCode: 400 , json: [ " msg " : " Test error " ] )
9389 let iterableRequest = IterableRequest . post ( PostRequest ( path: " " , args: nil , body: [ : ] ) )
9490
9591 createApiClient ( networkSession: MockNetworkSession ( statusCode: 400 , json: [ " msg " : " Test error " ] ) )
@@ -103,7 +99,6 @@ class IterableAPIResponseTests: XCTestCase {
10399
104100 func testResponseCode401( ) { // 401 = unauthorized
105101 let xpectation = expectation ( description: " 401 " )
106- let networkSession = MockNetworkSession ( statusCode: 401 )
107102 let iterableRequest = IterableRequest . post ( PostRequest ( path: " " , args: nil , body: [ : ] ) )
108103
109104 createApiClient ( networkSession: MockNetworkSession ( statusCode: 401 ) )
@@ -117,7 +112,6 @@ class IterableAPIResponseTests: XCTestCase {
117112
118113 func testResponseCode500( ) { // 500 = internal server error
119114 let xpectation = expectation ( description: " 500 " )
120- let networkSession = MockNetworkSession ( statusCode: 500 )
121115 let iterableRequest = IterableRequest . post ( PostRequest ( path: " " , args: nil , body: [ : ] ) )
122116
123117 createApiClient ( networkSession: MockNetworkSession ( statusCode: 500 ) )
@@ -131,7 +125,6 @@ class IterableAPIResponseTests: XCTestCase {
131125
132126 func testNon200ResponseCode( ) { // 302 = redirection
133127 let xpectation = expectation ( description: " non 200 " )
134- let networkSession = MockNetworkSession ( statusCode: 302 )
135128 let iterableRequest = IterableRequest . post ( PostRequest ( path: " " , args: nil , body: [ : ] ) )
136129
137130 createApiClient ( networkSession: MockNetworkSession ( statusCode: 302 ) )
@@ -145,7 +138,6 @@ class IterableAPIResponseTests: XCTestCase {
145138
146139 func testNoNetworkResponse( ) {
147140 let xpectation = expectation ( description: " no network response " )
148- let networkSession = NoNetworkNetworkSession ( )
149141 let iterableRequest = IterableRequest . post ( PostRequest ( path: " " , args: nil , body: [ : ] ) )
150142
151143 createApiClient ( networkSession: NoNetworkNetworkSession ( ) )
0 commit comments