Add test case in objc client

This commit is contained in:
geekerzp 2015-09-25 16:48:19 +08:00
parent 5e805c2be6
commit 6bdfb8810c
2 changed files with 24 additions and 2 deletions

View File

@ -2,6 +2,11 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>

View File

@ -218,8 +218,8 @@
[self waitForExpectationsWithTimeout:10.0 handler:nil];
}
- (void)testUploadFile {
XCTestExpectation *expectation = [self expectationWithDescription:@"testUploadWithFile"];
- (void)testUploadFileWithFormParameter {
XCTestExpectation *expectation = [self expectationWithDescription:@"testUploadWithFileWithFormParameter"];
NSURL *fileURL = [self createTempFile];
@ -236,6 +236,23 @@
[self waitForExpectationsWithTimeout:10.0 handler:nil];
}
- (void)testUploadFile {
XCTestExpectation *expectation = [self expectationWithDescription:@"testUploadFile"];
NSURL *fileURL = [self createTempFile];
[api uploadFileWithCompletionBlock:@1 additionalMetadata:nil file:fileURL completionHandler:^(NSError *error) {
if (error) {
XCTFail(@"expected a failure");
}
else {
[expectation fulfill];
}
}];
[self waitForExpectationsWithTimeout:10.0 handler:nil];
}
- (void)TestUploadWithoutFile {
XCTestExpectation *expectation = [self expectationWithDescription:@"testUploadWithoutFile"];