コード例 #1
0
        public async stt::Task GetDomainMappingRequestObjectAsync()
        {
            moq::Mock <DomainMappings.DomainMappingsClient> mockGrpcClient = new moq::Mock <DomainMappings.DomainMappingsClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            GetDomainMappingRequest request = new GetDomainMappingRequest
            {
                Name = "name1c9368b0",
            };
            DomainMapping expectedResponse = new DomainMapping
            {
                Name            = "name1c9368b0",
                Id              = "id74b70bb8",
                SslSettings     = new SslSettings(),
                ResourceRecords =
                {
                    new ResourceRecord(),
                },
            };

            mockGrpcClient.Setup(x => x.GetDomainMappingAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <DomainMapping>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            DomainMappingsClient client = new DomainMappingsClientImpl(mockGrpcClient.Object, null);
            DomainMapping        responseCallSettings = await client.GetDomainMappingAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            DomainMapping responseCancellationToken = await client.GetDomainMappingAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
コード例 #2
0
        public void GetDomainMappingRequestObject()
        {
            moq::Mock <DomainMappings.DomainMappingsClient> mockGrpcClient = new moq::Mock <DomainMappings.DomainMappingsClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            GetDomainMappingRequest request = new GetDomainMappingRequest
            {
                Name = "name1c9368b0",
            };
            DomainMapping expectedResponse = new DomainMapping
            {
                Name            = "name1c9368b0",
                Id              = "id74b70bb8",
                SslSettings     = new SslSettings(),
                ResourceRecords =
                {
                    new ResourceRecord(),
                },
            };

            mockGrpcClient.Setup(x => x.GetDomainMapping(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            DomainMappingsClient client   = new DomainMappingsClientImpl(mockGrpcClient.Object, null);
            DomainMapping        response = client.GetDomainMapping(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
コード例 #3
0
 /// <summary>Snippet for GetDomainMapping</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetDomainMappingRequestObject()
 {
     // Create client
     DomainMappingsClient domainMappingsClient = DomainMappingsClient.Create();
     // Initialize request argument(s)
     GetDomainMappingRequest request = new GetDomainMappingRequest {
         Name = "",
     };
     // Make the request
     DomainMapping response = domainMappingsClient.GetDomainMapping(request);
 }
コード例 #4
0
        /// <summary>Snippet for GetDomainMappingAsync</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 GetDomainMappingRequestObjectAsync()
        {
            // Create client
            DomainMappingsClient domainMappingsClient = await DomainMappingsClient.CreateAsync();

            // Initialize request argument(s)
            GetDomainMappingRequest request = new GetDomainMappingRequest {
                Name = "",
            };
            // Make the request
            DomainMapping response = await domainMappingsClient.GetDomainMappingAsync(request);
        }
コード例 #5
0
        /// <summary>Snippet for GetDomainMappingAsync</summary>
        public async Task GetDomainMappingRequestObjectAsync()
        {
            // Snippet: GetDomainMappingAsync(GetDomainMappingRequest, CallSettings)
            // Additional: GetDomainMappingAsync(GetDomainMappingRequest, CancellationToken)
            // Create client
            DomainMappingsClient domainMappingsClient = await DomainMappingsClient.CreateAsync();

            // Initialize request argument(s)
            GetDomainMappingRequest request = new GetDomainMappingRequest {
                Name = "",
            };
            // Make the request
            DomainMapping response = await domainMappingsClient.GetDomainMappingAsync(request);

            // End snippet
        }
コード例 #6
0
 /// <summary>
 /// Gets the specified domain mapping.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public override stt::Task <DomainMapping> GetDomainMappingAsync(GetDomainMappingRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_GetDomainMappingRequest(ref request, ref callSettings);
     return(_callGetDomainMapping.Async(request, callSettings));
 }
コード例 #7
0
 /// <summary>
 /// Gets the specified domain mapping.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>The RPC response.</returns>
 public override DomainMapping GetDomainMapping(GetDomainMappingRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_GetDomainMappingRequest(ref request, ref callSettings);
     return(_callGetDomainMapping.Sync(request, callSettings));
 }
コード例 #8
0
 partial void Modify_GetDomainMappingRequest(ref GetDomainMappingRequest request, ref gaxgrpc::CallSettings settings);
コード例 #9
0
 /// <summary>
 /// Gets the specified domain mapping.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="cancellationToken">A <see cref="st::CancellationToken"/> to use for this RPC.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public virtual stt::Task <DomainMapping> GetDomainMappingAsync(GetDomainMappingRequest request, st::CancellationToken cancellationToken) =>
 GetDomainMappingAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
コード例 #10
0
 /// <summary>
 /// Gets the specified domain mapping.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public virtual stt::Task <DomainMapping> GetDomainMappingAsync(GetDomainMappingRequest request, gaxgrpc::CallSettings callSettings = null) =>
 throw new sys::NotImplementedException();
コード例 #11
0
 /// <summary>
 /// Gets the specified domain mapping.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>The RPC response.</returns>
 public virtual DomainMapping GetDomainMapping(GetDomainMappingRequest request, gaxgrpc::CallSettings callSettings = null) =>
 throw new sys::NotImplementedException();