TwitterNetworkLayerTests/TNLRequestOperationTest.m [611:654]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        XCTAssertEqualObjects(response.result[@"args"], args);
        XCTAssertEqualObjects(response.result[@"json"], kBODY_DICTIONARY);
        XCTAssertFalse(response.responseBodyWasInFile);
    }];

    // Save to Disk
    config.responseDataConsumptionMode = TNLResponseDataConsumptionModeSaveToDisk;
    config.executionMode = TNLRequestExecutionModeInApp;

    [self performRequest:request config:config args:args callback:^(TestJSONResponse *response) {
        NSError *error = CoersedOperationError(response.operationError);
        XCTAssertEqualObjects(error.domain, TNLErrorDomain);
        XCTAssertEqual(error.code, TNLErrorCodeRequestHTTPBodyCannotBeSetForDownload);
    }];

#if !RUN_TESTS_WITH_CANNED_RESPONSES

#if RUN_BACKGROUND_REQUESTS

    // Background - Normal
    config.responseDataConsumptionMode = TNLResponseDataConsumptionModeStoreInMemory;
    config.executionMode = TNLRequestExecutionModeBackground;

    [self performRequest:request config:config args:args callback:^(TestJSONResponse *response) {
        XCTAssertEqual(response.info.statusCode, 200);
        XCTAssertNotNil(response.result);
        XCTAssertEqualObjects([response.result[@"headers"] tnl_objectForCaseInsensitiveKey:@"TNL-Version"], TNLVersion());
        XCTAssertEqual([[response.result[@"headers"] tnl_objectForCaseInsensitiveKey:@"Content-Length"] integerValue], (NSInteger)self.uploadData.length);
        XCTAssertEqualObjects(response.result[@"args"], args);
        XCTAssertEqualObjects(response.result[@"json"], kBODY_DICTIONARY);
        XCTAssertFalse(response.responseBodyWasInFile);
    }];

#endif // RUN_BACKGROUND_REQUESTS

    // Background - Save to Disk
    config.responseDataConsumptionMode = TNLResponseDataConsumptionModeSaveToDisk;
    config.executionMode = TNLRequestExecutionModeInApp;

    [self performRequest:request config:config args:args callback:^(TestJSONResponse *response) {
        NSError *error = CoersedOperationError(response.operationError);
        XCTAssertEqualObjects(error.domain, TNLErrorDomain);
        XCTAssertEqual(error.code, TNLErrorCodeRequestHTTPBodyCannotBeSetForDownload);
    }];
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



TwitterNetworkLayerTests/TNLRequestOperationTest.m [861:904]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        XCTAssertEqualObjects(response.result[@"args"], args);
        XCTAssertEqualObjects(response.result[@"json"], kBODY_DICTIONARY);
        XCTAssertFalse(response.responseBodyWasInFile);
    }];

    // Save to Disk
    config.responseDataConsumptionMode = TNLResponseDataConsumptionModeSaveToDisk;
    config.executionMode = TNLRequestExecutionModeInApp;

    [self performRequest:request config:config args:args callback:^(TestJSONResponse *response) {
        NSError *error = CoersedOperationError(response.operationError);
        XCTAssertEqualObjects(error.domain, TNLErrorDomain);
        XCTAssertEqual(error.code, TNLErrorCodeRequestHTTPBodyCannotBeSetForDownload);
    }];

#if !RUN_TESTS_WITH_CANNED_RESPONSES

#if RUN_BACKGROUND_REQUESTS

    // Background - Normal
    config.responseDataConsumptionMode = TNLResponseDataConsumptionModeStoreInMemory;
    config.executionMode = TNLRequestExecutionModeBackground;

    [self performRequest:request config:config args:args callback:^(TestJSONResponse *response) {
        XCTAssertEqual(response.info.statusCode, 200);
        XCTAssertNotNil(response.result);
        XCTAssertEqualObjects([response.result[@"headers"] tnl_objectForCaseInsensitiveKey:@"TNL-Version"], TNLVersion());
        XCTAssertEqual([[response.result[@"headers"] tnl_objectForCaseInsensitiveKey:@"Content-Length"] integerValue], (NSInteger)self.uploadData.length);
        XCTAssertEqualObjects(response.result[@"args"], args);
        XCTAssertEqualObjects(response.result[@"json"], kBODY_DICTIONARY);
        XCTAssertFalse(response.responseBodyWasInFile);
    }];

#endif // RUN_BACKGROUND_REQUESTS

    // Background - Save to Disk
    config.responseDataConsumptionMode = TNLResponseDataConsumptionModeSaveToDisk;
    config.executionMode = TNLRequestExecutionModeInApp;

    [self performRequest:request config:config args:args callback:^(TestJSONResponse *response) {
        NSError *error = CoersedOperationError(response.operationError);
        XCTAssertEqualObjects(error.domain, TNLErrorDomain);
        XCTAssertEqual(error.code, TNLErrorCodeRequestHTTPBodyCannotBeSetForDownload);
    }];
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



