public void MutateCustomerManagerLink() { moq::Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient> mockGrpcClient = new moq::Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient>(moq::MockBehavior.Strict); MutateCustomerManagerLinkRequest request = new MutateCustomerManagerLinkRequest { CustomerId = "customer_id3b3724cb", Operations = { new CustomerManagerLinkOperation(), }, }; MutateCustomerManagerLinkResponse expectedResponse = new MutateCustomerManagerLinkResponse { Results = { new MutateCustomerManagerLinkResult(), }, }; mockGrpcClient.Setup(x => x.MutateCustomerManagerLink(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); CustomerManagerLinkServiceClient client = new CustomerManagerLinkServiceClientImpl(mockGrpcClient.Object, null); MutateCustomerManagerLinkResponse response = client.MutateCustomerManagerLink(request.CustomerId, request.Operations); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async stt::Task GetCustomerManagerLinkRequestObjectAsync() { moq::Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient> mockGrpcClient = new moq::Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient>(moq::MockBehavior.Strict); GetCustomerManagerLinkRequest request = new GetCustomerManagerLinkRequest { ResourceNameAsCustomerManagerLinkName = gagvr::CustomerManagerLinkName.FromCustomerManagerCustomerManagerLink("[CUSTOMER_ID]", "[MANAGER_CUSTOMER_ID]", "[MANAGER_LINK_ID]"), }; gagvr::CustomerManagerLink expectedResponse = new gagvr::CustomerManagerLink { ResourceNameAsCustomerManagerLinkName = gagvr::CustomerManagerLinkName.FromCustomerManagerCustomerManagerLink("[CUSTOMER_ID]", "[MANAGER_CUSTOMER_ID]", "[MANAGER_LINK_ID]"), Status = gagve::ManagerLinkStatusEnum.Types.ManagerLinkStatus.Inactive, ManagerCustomer = "manager_customer3075601e", ManagerLinkId = 1955158851327798968L, }; mockGrpcClient.Setup(x => x.GetCustomerManagerLinkAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <gagvr::CustomerManagerLink>(stt::Task.FromResult(expectedResponse), null, null, null, null)); CustomerManagerLinkServiceClient client = new CustomerManagerLinkServiceClientImpl(mockGrpcClient.Object, null); gagvr::CustomerManagerLink responseCallSettings = await client.GetCustomerManagerLinkAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); Assert.AreEqual(expectedResponse, responseCallSettings); gagvr::CustomerManagerLink responseCancellationToken = await client.GetCustomerManagerLinkAsync(request, st::CancellationToken.None); Assert.AreEqual(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public async stt::Task MutateCustomerManagerLinkAsync() { moq::Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient> mockGrpcClient = new moq::Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient>(moq::MockBehavior.Strict); MutateCustomerManagerLinkRequest request = new MutateCustomerManagerLinkRequest { CustomerId = "customer_id3b3724cb", Operations = { new CustomerManagerLinkOperation(), }, }; MutateCustomerManagerLinkResponse expectedResponse = new MutateCustomerManagerLinkResponse { Results = { new MutateCustomerManagerLinkResult(), }, }; mockGrpcClient.Setup(x => x.MutateCustomerManagerLinkAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <MutateCustomerManagerLinkResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); CustomerManagerLinkServiceClient client = new CustomerManagerLinkServiceClientImpl(mockGrpcClient.Object, null); MutateCustomerManagerLinkResponse responseCallSettings = await client.MutateCustomerManagerLinkAsync(request.CustomerId, request.Operations, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); Assert.AreEqual(expectedResponse, responseCallSettings); MutateCustomerManagerLinkResponse responseCancellationToken = await client.MutateCustomerManagerLinkAsync(request.CustomerId, request.Operations, st::CancellationToken.None); Assert.AreEqual(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public async Task MoveManagerLinkAsync() { Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient> mockGrpcClient = new Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient>(MockBehavior.Strict); MoveManagerLinkRequest expectedRequest = new MoveManagerLinkRequest { CustomerId = "customerId-1772061412", PreviousCustomerManagerLink = "previousCustomerManagerLink-1454597947", NewManager = "newManager90619918", }; MoveManagerLinkResponse expectedResponse = new MoveManagerLinkResponse { ResourceName = "resourceName979421212", }; mockGrpcClient.Setup(x => x.MoveManagerLinkAsync(expectedRequest, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <MoveManagerLinkResponse>(Task.FromResult(expectedResponse), null, null, null, null)); CustomerManagerLinkServiceClient client = new CustomerManagerLinkServiceClientImpl(mockGrpcClient.Object, null); string customerId = "customerId-1772061412"; string previousCustomerManagerLink = "previousCustomerManagerLink-1454597947"; string newManager = "newManager90619918"; MoveManagerLinkResponse response = await client.MoveManagerLinkAsync(customerId, previousCustomerManagerLink, newManager); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async stt::Task MoveManagerLinkRequestObjectAsync() { moq::Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient> mockGrpcClient = new moq::Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient>(moq::MockBehavior.Strict); MoveManagerLinkRequest request = new MoveManagerLinkRequest { CustomerId = "customer_id3b3724cb", PreviousCustomerManagerLink = "previous_customer_manager_linkb33a0aa8", NewManager = "new_managerbf35b8c4", ValidateOnly = true, }; MoveManagerLinkResponse expectedResponse = new MoveManagerLinkResponse { ResourceNameAsCustomerManagerLinkName = gagvr::CustomerManagerLinkName.FromCustomerManagerCustomerManagerLink("[CUSTOMER_ID]", "[MANAGER_CUSTOMER_ID]", "[MANAGER_LINK_ID]"), }; mockGrpcClient.Setup(x => x.MoveManagerLinkAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <MoveManagerLinkResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); CustomerManagerLinkServiceClient client = new CustomerManagerLinkServiceClientImpl(mockGrpcClient.Object, null); MoveManagerLinkResponse responseCallSettings = await client.MoveManagerLinkAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); Assert.AreEqual(expectedResponse, responseCallSettings); MoveManagerLinkResponse responseCancellationToken = await client.MoveManagerLinkAsync(request, st::CancellationToken.None); Assert.AreEqual(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public async Task MutateCustomerManagerLinkAsync2() { Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient> mockGrpcClient = new Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient>(MockBehavior.Strict); MutateCustomerManagerLinkRequest request = new MutateCustomerManagerLinkRequest { CustomerId = "customerId-1772061412", Operations = { }, }; MutateCustomerManagerLinkResponse expectedResponse = new MutateCustomerManagerLinkResponse(); mockGrpcClient.Setup(x => x.MutateCustomerManagerLinkAsync(request, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <MutateCustomerManagerLinkResponse>(Task.FromResult(expectedResponse), null, null, null, null)); CustomerManagerLinkServiceClient client = new CustomerManagerLinkServiceClientImpl(mockGrpcClient.Object, null); MutateCustomerManagerLinkResponse response = await client.MutateCustomerManagerLinkAsync(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void MutateCustomerManagerLink2() { Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient> mockGrpcClient = new Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient>(MockBehavior.Strict); MutateCustomerManagerLinkRequest request = new MutateCustomerManagerLinkRequest { CustomerId = "customerId-1772061412", Operations = { }, }; MutateCustomerManagerLinkResponse expectedResponse = new MutateCustomerManagerLinkResponse(); mockGrpcClient.Setup(x => x.MutateCustomerManagerLink(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); CustomerManagerLinkServiceClient client = new CustomerManagerLinkServiceClientImpl(mockGrpcClient.Object, null); MutateCustomerManagerLinkResponse response = client.MutateCustomerManagerLink(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void GetCustomerManagerLink2() { Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient> mockGrpcClient = new Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient>(MockBehavior.Strict); GetCustomerManagerLinkRequest request = new GetCustomerManagerLinkRequest { ResourceName = new CustomerManagerLinkName("[CUSTOMER]", "[CUSTOMER_MANAGER_LINK]").ToString(), }; CustomerManagerLink expectedResponse = new CustomerManagerLink { ResourceName = "resourceName2625949903", }; mockGrpcClient.Setup(x => x.GetCustomerManagerLink(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); CustomerManagerLinkServiceClient client = new CustomerManagerLinkServiceClientImpl(mockGrpcClient.Object, null); CustomerManagerLink response = client.GetCustomerManagerLink(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async Task GetCustomerManagerLinkAsync2() { Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient> mockGrpcClient = new Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient>(MockBehavior.Strict); GetCustomerManagerLinkRequest request = new GetCustomerManagerLinkRequest { ResourceName = new CustomerManagerLinkName("[CUSTOMER]", "[CUSTOMER_MANAGER_LINK]").ToString(), }; CustomerManagerLink expectedResponse = new CustomerManagerLink { ResourceName = "resourceName2625949903", }; mockGrpcClient.Setup(x => x.GetCustomerManagerLinkAsync(request, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <CustomerManagerLink>(Task.FromResult(expectedResponse), null, null, null, null)); CustomerManagerLinkServiceClient client = new CustomerManagerLinkServiceClientImpl(mockGrpcClient.Object, null); CustomerManagerLink response = await client.GetCustomerManagerLinkAsync(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void MoveManagerLink() { moq::Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient> mockGrpcClient = new moq::Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient>(moq::MockBehavior.Strict); MoveManagerLinkRequest request = new MoveManagerLinkRequest { CustomerId = "customer_id3b3724cb", PreviousCustomerManagerLink = "previous_customer_manager_linkb33a0aa8", NewManager = "new_managerbf35b8c4", }; MoveManagerLinkResponse expectedResponse = new MoveManagerLinkResponse { ResourceName = "resource_name8cc2e687", }; mockGrpcClient.Setup(x => x.MoveManagerLink(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); CustomerManagerLinkServiceClient client = new CustomerManagerLinkServiceClientImpl(mockGrpcClient.Object, null); MoveManagerLinkResponse response = client.MoveManagerLink(request.CustomerId, request.PreviousCustomerManagerLink, request.NewManager); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void GetCustomerManagerLink() { moq::Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient> mockGrpcClient = new moq::Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient>(moq::MockBehavior.Strict); GetCustomerManagerLinkRequest request = new GetCustomerManagerLinkRequest { ResourceNameAsCustomerManagerLinkName = gagvr::CustomerManagerLinkName.FromCustomerManagerCustomerManagerLink("[CUSTOMER_ID]", "[MANAGER_CUSTOMER_ID]", "[MANAGER_LINK_ID]"), }; gagvr::CustomerManagerLink expectedResponse = new gagvr::CustomerManagerLink { ResourceNameAsCustomerManagerLinkName = gagvr::CustomerManagerLinkName.FromCustomerManagerCustomerManagerLink("[CUSTOMER_ID]", "[MANAGER_CUSTOMER_ID]", "[MANAGER_LINK_ID]"), Status = gagve::ManagerLinkStatusEnum.Types.ManagerLinkStatus.Inactive, ManagerCustomer = "manager_customer3075601e", ManagerLinkId = 1955158851327798968L, }; mockGrpcClient.Setup(x => x.GetCustomerManagerLink(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); CustomerManagerLinkServiceClient client = new CustomerManagerLinkServiceClientImpl(mockGrpcClient.Object, null); gagvr::CustomerManagerLink response = client.GetCustomerManagerLink(request.ResourceName); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void MoveManagerLinkRequestObject() { moq::Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient> mockGrpcClient = new moq::Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient>(moq::MockBehavior.Strict); MoveManagerLinkRequest request = new MoveManagerLinkRequest { CustomerId = "customer_id3b3724cb", PreviousCustomerManagerLink = "previous_customer_manager_linkb33a0aa8", NewManager = "new_managerbf35b8c4", ValidateOnly = true, }; MoveManagerLinkResponse expectedResponse = new MoveManagerLinkResponse { ResourceNameAsCustomerManagerLinkName = gagvr::CustomerManagerLinkName.FromCustomerManagerCustomerManagerLink("[CUSTOMER_ID]", "[MANAGER_CUSTOMER_ID]", "[MANAGER_LINK_ID]"), }; mockGrpcClient.Setup(x => x.MoveManagerLink(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); CustomerManagerLinkServiceClient client = new CustomerManagerLinkServiceClientImpl(mockGrpcClient.Object, null); MoveManagerLinkResponse response = client.MoveManagerLink(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void MoveManagerLink2() { Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient> mockGrpcClient = new Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient>(MockBehavior.Strict); MoveManagerLinkRequest request = new MoveManagerLinkRequest { CustomerId = "customerId-1772061412", PreviousCustomerManagerLink = "previousCustomerManagerLink-1454597947", NewManager = "newManager90619918", }; MoveManagerLinkResponse expectedResponse = new MoveManagerLinkResponse { ResourceName = "resourceName979421212", }; mockGrpcClient.Setup(x => x.MoveManagerLink(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); CustomerManagerLinkServiceClient client = new CustomerManagerLinkServiceClientImpl(mockGrpcClient.Object, null); MoveManagerLinkResponse response = client.MoveManagerLink(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async stt::Task MoveManagerLinkAsync() { moq::Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient> mockGrpcClient = new moq::Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient>(moq::MockBehavior.Strict); MoveManagerLinkRequest request = new MoveManagerLinkRequest { CustomerId = "customer_id3b3724cb", PreviousCustomerManagerLink = "previous_customer_manager_linkb33a0aa8", NewManager = "new_managerbf35b8c4", }; MoveManagerLinkResponse expectedResponse = new MoveManagerLinkResponse { ResourceName = "resource_name8cc2e687", }; mockGrpcClient.Setup(x => x.MoveManagerLinkAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <MoveManagerLinkResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); CustomerManagerLinkServiceClient client = new CustomerManagerLinkServiceClientImpl(mockGrpcClient.Object, null); MoveManagerLinkResponse responseCallSettings = await client.MoveManagerLinkAsync(request.CustomerId, request.PreviousCustomerManagerLink, request.NewManager, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); MoveManagerLinkResponse responseCancellationToken = await client.MoveManagerLinkAsync(request.CustomerId, request.PreviousCustomerManagerLink, request.NewManager, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }