public void SuggestGeoTargetConstantsRequestObject() { moq::Mock <GeoTargetConstantService.GeoTargetConstantServiceClient> mockGrpcClient = new moq::Mock <GeoTargetConstantService.GeoTargetConstantServiceClient>(moq::MockBehavior.Strict); SuggestGeoTargetConstantsRequest request = new SuggestGeoTargetConstantsRequest { LocationNames = new SuggestGeoTargetConstantsRequest.Types.LocationNames(), GeoTargets = new SuggestGeoTargetConstantsRequest.Types.GeoTargets(), Locale = "locale9e6d21fb", CountryCode = "country_code8debec55", }; SuggestGeoTargetConstantsResponse expectedResponse = new SuggestGeoTargetConstantsResponse { GeoTargetConstantSuggestions = { new GeoTargetConstantSuggestion(), }, }; mockGrpcClient.Setup(x => x.SuggestGeoTargetConstants(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); GeoTargetConstantServiceClient client = new GeoTargetConstantServiceClientImpl(mockGrpcClient.Object, null); SuggestGeoTargetConstantsResponse response = client.SuggestGeoTargetConstants(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void SuggestGeoTargetConstants2() { Mock <GeoTargetConstantService.GeoTargetConstantServiceClient> mockGrpcClient = new Mock <GeoTargetConstantService.GeoTargetConstantServiceClient>(MockBehavior.Strict); SuggestGeoTargetConstantsRequest request = new SuggestGeoTargetConstantsRequest { Locale = null, CountryCode = null, }; SuggestGeoTargetConstantsResponse expectedResponse = new SuggestGeoTargetConstantsResponse(); mockGrpcClient.Setup(x => x.SuggestGeoTargetConstants(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); GeoTargetConstantServiceClient client = new GeoTargetConstantServiceClientImpl(mockGrpcClient.Object, null); SuggestGeoTargetConstantsResponse response = client.SuggestGeoTargetConstants(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void SuggestGeoTargetConstants() { Mock <GeoTargetConstantService.GeoTargetConstantServiceClient> mockGrpcClient = new Mock <GeoTargetConstantService.GeoTargetConstantServiceClient>(MockBehavior.Strict); SuggestGeoTargetConstantsRequest expectedRequest = new SuggestGeoTargetConstantsRequest { Locale = new StringValue().Value, // TODO(liseno): Implicit type cast from StringValue to String failed, CountryCode = new StringValue().Value, // TODO(liseno): Implicit type cast from StringValue to String failed, }; SuggestGeoTargetConstantsResponse expectedResponse = new SuggestGeoTargetConstantsResponse(); mockGrpcClient.Setup(x => x.SuggestGeoTargetConstants(expectedRequest, It.IsAny <CallOptions>())) .Returns(expectedResponse); GeoTargetConstantServiceClient client = new GeoTargetConstantServiceClientImpl(mockGrpcClient.Object, null); StringValue locale = new StringValue(); StringValue countryCode = new StringValue(); SuggestGeoTargetConstantsResponse response = client.SuggestGeoTargetConstants(locale, countryCode); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }