public async stt::Task UpdateChannelPartnerLinkRequestObjectAsync() { moq::Mock <CloudChannelService.CloudChannelServiceClient> mockGrpcClient = new moq::Mock <CloudChannelService.CloudChannelServiceClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object); UpdateChannelPartnerLinkRequest request = new UpdateChannelPartnerLinkRequest { Name = "name1c9368b0", ChannelPartnerLink = new ChannelPartnerLink(), UpdateMask = new wkt::FieldMask(), }; ChannelPartnerLink expectedResponse = new ChannelPartnerLink { Name = "name1c9368b0", ResellerCloudIdentityId = "reseller_cloud_identity_id1b90ae2b", LinkState = ChannelPartnerLinkState.Revoked, InviteLinkUri = "invite_link_urie81ac099", CreateTime = new wkt::Timestamp(), UpdateTime = new wkt::Timestamp(), PublicId = "public_id4d74e21e", ChannelPartnerCloudIdentityInfo = new CloudIdentityInfo(), }; mockGrpcClient.Setup(x => x.UpdateChannelPartnerLinkAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <ChannelPartnerLink>(stt::Task.FromResult(expectedResponse), null, null, null, null)); CloudChannelServiceClient client = new CloudChannelServiceClientImpl(mockGrpcClient.Object, null); ChannelPartnerLink responseCallSettings = await client.UpdateChannelPartnerLinkAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); ChannelPartnerLink responseCancellationToken = await client.UpdateChannelPartnerLinkAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public void UpdateChannelPartnerLinkRequestObject() { moq::Mock <CloudChannelService.CloudChannelServiceClient> mockGrpcClient = new moq::Mock <CloudChannelService.CloudChannelServiceClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object); UpdateChannelPartnerLinkRequest request = new UpdateChannelPartnerLinkRequest { Name = "name1c9368b0", ChannelPartnerLink = new ChannelPartnerLink(), UpdateMask = new wkt::FieldMask(), }; ChannelPartnerLink expectedResponse = new ChannelPartnerLink { Name = "name1c9368b0", ResellerCloudIdentityId = "reseller_cloud_identity_id1b90ae2b", LinkState = ChannelPartnerLinkState.Revoked, InviteLinkUri = "invite_link_urie81ac099", CreateTime = new wkt::Timestamp(), UpdateTime = new wkt::Timestamp(), PublicId = "public_id4d74e21e", ChannelPartnerCloudIdentityInfo = new CloudIdentityInfo(), }; mockGrpcClient.Setup(x => x.UpdateChannelPartnerLink(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); CloudChannelServiceClient client = new CloudChannelServiceClientImpl(mockGrpcClient.Object, null); ChannelPartnerLink response = client.UpdateChannelPartnerLink(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for UpdateChannelPartnerLink</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void UpdateChannelPartnerLinkRequestObject() { // Create client CloudChannelServiceClient cloudChannelServiceClient = CloudChannelServiceClient.Create(); // Initialize request argument(s) UpdateChannelPartnerLinkRequest request = new UpdateChannelPartnerLinkRequest { Name = "", ChannelPartnerLink = new ChannelPartnerLink(), UpdateMask = new FieldMask(), }; // Make the request ChannelPartnerLink response = cloudChannelServiceClient.UpdateChannelPartnerLink(request); }