public async stt::Task GetServiceConfigAsync() { moq::Mock <ServiceManager.ServiceManagerClient> mockGrpcClient = new moq::Mock <ServiceManager.ServiceManagerClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object); GetServiceConfigRequest request = new GetServiceConfigRequest { ServiceName = "service_named5df05d5", ConfigId = "config_id908a73d1", View = GetServiceConfigRequest.Types.ConfigView.Full, }; ga::Service expectedResponse = new ga::Service { Name = "name1c9368b0", Title = "title17dbd3d5", Apis = { new wkt::Api(), }, Types_ = { new wkt::Type(), }, Enums = { new wkt::Enum(), }, Documentation = new ga::Documentation(), Backend = new ga::Backend(), Http = new ga::Http(), Quota = new ga::Quota(), Authentication = new ga::Authentication(), Context = new ga::Context(), Usage = new ga::Usage(), Endpoints = { new ga::Endpoint(), }, ConfigVersion = 2430367190U, Control = new ga::Control(), ProducerProjectId = "producer_project_id18d0012a", Logs = { new ga::LogDescriptor(), }, Metrics = { new ga::MetricDescriptor(), }, MonitoredResources = { new ga::MonitoredResourceDescriptor(), }, Billing = new ga::Billing(), Logging = new ga::Logging(), Monitoring = new ga::Monitoring(), SystemParameters = new ga::SystemParameters(), Id = "id74b70bb8", SourceInfo = new ga::SourceInfo(), }; mockGrpcClient.Setup(x => x.GetServiceConfigAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <ga::Service>(stt::Task.FromResult(expectedResponse), null, null, null, null)); ServiceManagerClient client = new ServiceManagerClientImpl(mockGrpcClient.Object, null); ga::Service responseCallSettings = await client.GetServiceConfigAsync(request.ServiceName, request.ConfigId, request.View, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); ga::Service responseCancellationToken = await client.GetServiceConfigAsync(request.ServiceName, request.ConfigId, request.View, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for GetServiceConfig</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void GetServiceConfigRequestObject() { // Create client ServiceManagerClient serviceManagerClient = ServiceManagerClient.Create(); // Initialize request argument(s) GetServiceConfigRequest request = new GetServiceConfigRequest { ServiceName = "", ConfigId = "", View = GetServiceConfigRequest.Types.ConfigView.Basic, }; // Make the request Service response = serviceManagerClient.GetServiceConfig(request); }
/// <summary>Snippet for GetServiceConfigAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task GetServiceConfigRequestObjectAsync() { // Create client ServiceManagerClient serviceManagerClient = await ServiceManagerClient.CreateAsync(); // Initialize request argument(s) GetServiceConfigRequest request = new GetServiceConfigRequest { ServiceName = "", ConfigId = "", View = GetServiceConfigRequest.Types.ConfigView.Basic, }; // Make the request Service response = await serviceManagerClient.GetServiceConfigAsync(request); }