Skip to content
Snippets Groups Projects
Commit 25e28e80 authored by Jorge Canizales's avatar Jorge Canizales
Browse files

Fixes proto remote test to use the actual protos of the service.

parent d168f50e
No related branches found
No related tags found
No related merge requests found
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#import <gRPC/GRPCCall.h> #import <gRPC/GRPCCall.h>
#import <gRPC/GRPCMethodName.h> #import <gRPC/GRPCMethodName.h>
#import <Route_guide/Route_guide.pb.h> #import <RemoteTest/Messages.pb.h>
#import <RxLibrary/GRXWriter+Immediate.h> #import <RxLibrary/GRXWriter+Immediate.h>
#import <RxLibrary/GRXWriteable.h> #import <RxLibrary/GRXWriteable.h>
...@@ -111,8 +111,12 @@ ...@@ -111,8 +111,12 @@
interface:@"TestService" interface:@"TestService"
method:@"UnaryCall"]; method:@"UnaryCall"];
RGDPoint *point = [[[[[RGDPointBuilder alloc] init] setLatitude:28E7] setLongitude:-15E7] build]; RMTSimpleRequest *request = [[[[[[RMTSimpleRequestBuilder alloc] init]
id<GRXWriter> requestsWriter = [GRXWriter writerWithValue:[point data]]; setResponseSize:100]
setFillUsername:YES]
setFillOauthScope:YES]
build];
id<GRXWriter> requestsWriter = [GRXWriter writerWithValue:[request data]];
GRPCCall *call = [[GRPCCall alloc] initWithHost:@"grpc-test.sandbox.google.com" GRPCCall *call = [[GRPCCall alloc] initWithHost:@"grpc-test.sandbox.google.com"
method:method method:method
...@@ -121,9 +125,11 @@ ...@@ -121,9 +125,11 @@
id<GRXWriteable> responsesWriteable = [[GRXWriteable alloc] initWithValueHandler:^(NSData *value) { id<GRXWriteable> responsesWriteable = [[GRXWriteable alloc] initWithValueHandler:^(NSData *value) {
XCTAssertNotNil(value, @"nil value received as response."); XCTAssertNotNil(value, @"nil value received as response.");
[response fulfill]; [response fulfill];
RGDFeature *feature = [RGDFeature parseFromData:value]; XCTAssertGreaterThan(value.length, 0, @"Empty response received.");
XCTAssertEqualObjects(point, feature.location); RMTSimpleResponse *response = [RMTSimpleResponse parseFromData:value];
XCTAssertNotNil(feature.name, @"Response's name is nil."); // We expect empty strings, not nil:
XCTAssertNotNil(response.username, @"Response's username is nil.");
XCTAssertNotNil(response.oauthScope, @"Response's OAuth scope is nil.");
[expectedResponse fulfill]; [expectedResponse fulfill];
} completionHandler:^(NSError *errorOrNil) { } completionHandler:^(NSError *errorOrNil) {
XCTAssertNil(errorOrNil, @"Finished with unexpected error: %@", errorOrNil); XCTAssertNil(errorOrNil, @"Finished with unexpected error: %@", errorOrNil);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment