Test call and error metadata are the same.

pull/2051/head
Jorge Canizales 10 years ago
parent f3a4f2cee9
commit 8c6bc6e5aa
  1. 2
      src/objective-c/tests/GRPCClientTests.m

@ -163,6 +163,8 @@ static GRPCMethodName *kUnaryCallMethod;
} completionHandler:^(NSError *errorOrNil) { } completionHandler:^(NSError *errorOrNil) {
XCTAssertNotNil(errorOrNil, @"Finished without error!"); XCTAssertNotNil(errorOrNil, @"Finished without error!");
XCTAssertEqual(errorOrNil.code, 16, @"Finished with unexpected error: %@", errorOrNil); XCTAssertEqual(errorOrNil.code, 16, @"Finished with unexpected error: %@", errorOrNil);
XCTAssertEqualObjects(call.responseMetadata, errorOrNil.userInfo[kGRPCStatusMetadataKey],
@"Metadata in the NSError object and call object differ.");
NSString *challengeHeader = call.responseMetadata[@"www-authenticate"][0]; NSString *challengeHeader = call.responseMetadata[@"www-authenticate"][0];
XCTAssertGreaterThan(challengeHeader.length, 0, XCTAssertGreaterThan(challengeHeader.length, 0,
@"No challenge in response headers %@", call.responseMetadata); @"No challenge in response headers %@", call.responseMetadata);

Loading…
Cancel
Save