| | using Google; |
| | using Google.Apis.CloudMachineLearningEngine.v1; |
| | using Google.Apis.CloudMachineLearningEngine.v1.Data; |
| | using Google.Apis.Services; |
| | using IntegrationTests.Utils; |
| | using System; |
| | using System.Collections.Generic; |
| | using System.Net.Http; |
| | using System.Text; |
| | using Xunit; |
| |
|
| | namespace IntegrationTests |
| | { |
| | public class RestPathTests |
| | { |
| | [Fact] |
| | public void ColonCorrectness() |
| | { |
| | |
| | |
| | |
| | |
| | |
| | var client = new CloudMachineLearningEngineService(new BaseClientService.Initializer |
| | { |
| | HttpClientInitializer = Helper.GetServiceCredential() |
| | .CreateScoped(CloudMachineLearningEngineService.Scope.CloudPlatform), |
| | ApplicationName = "IntegrationTest" |
| | }); |
| | var emptyBody = new GoogleCloudMlV1PredictRequest { HttpBody = new GoogleApiHttpBody() }; |
| | var request = client.Projects.Predict(emptyBody, "projects/dummyProject"); |
| | request.ModifyRequest = httpRequestMessage => |
| | { |
| | httpRequestMessage.Content = new StringContent("dummyRequest", Encoding.UTF8, "application/json"); |
| | }; |
| | var ex = Assert.Throws<GoogleApiException>(() => request.Execute()); |
| | Assert.Contains("Permission denied on resource project dummyProject", ex.Message); |
| | } |
| | } |
| | } |
| |
|