diff --git a/samples/client/petstore/objc/SwaggerClientTests/Tests/PetApiTest.m b/samples/client/petstore/objc/SwaggerClientTests/Tests/PetApiTest.m index f861cb0605e..68add577ac1 100644 --- a/samples/client/petstore/objc/SwaggerClientTests/Tests/PetApiTest.m +++ b/samples/client/petstore/objc/SwaggerClientTests/Tests/PetApiTest.m @@ -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"];