public async stt::Task GetTransitionRouteGroupRequestObjectAsync() { moq::Mock <TransitionRouteGroups.TransitionRouteGroupsClient> mockGrpcClient = new moq::Mock <TransitionRouteGroups.TransitionRouteGroupsClient>(moq::MockBehavior.Strict); GetTransitionRouteGroupRequest request = new GetTransitionRouteGroupRequest { TransitionRouteGroupName = TransitionRouteGroupName.FromProjectLocationAgentFlowTransitionRouteGroup("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"), LanguageCode = "language_code2f6c7160", }; TransitionRouteGroup expectedResponse = new TransitionRouteGroup { TransitionRouteGroupName = TransitionRouteGroupName.FromProjectLocationAgentFlowTransitionRouteGroup("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"), DisplayName = "display_name137f65c2", TransitionRoutes = { new TransitionRoute(), }, }; mockGrpcClient.Setup(x => x.GetTransitionRouteGroupAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <TransitionRouteGroup>(stt::Task.FromResult(expectedResponse), null, null, null, null)); TransitionRouteGroupsClient client = new TransitionRouteGroupsClientImpl(mockGrpcClient.Object, null); TransitionRouteGroup responseCallSettings = await client.GetTransitionRouteGroupAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); TransitionRouteGroup responseCancellationToken = await client.GetTransitionRouteGroupAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public void UpdateTransitionRouteGroup() { moq::Mock <TransitionRouteGroups.TransitionRouteGroupsClient> mockGrpcClient = new moq::Mock <TransitionRouteGroups.TransitionRouteGroupsClient>(moq::MockBehavior.Strict); UpdateTransitionRouteGroupRequest request = new UpdateTransitionRouteGroupRequest { TransitionRouteGroup = new TransitionRouteGroup(), UpdateMask = new wkt::FieldMask(), }; TransitionRouteGroup expectedResponse = new TransitionRouteGroup { TransitionRouteGroupName = TransitionRouteGroupName.FromProjectLocationAgentFlowTransitionRouteGroup("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"), DisplayName = "display_name137f65c2", TransitionRoutes = { new TransitionRoute(), }, }; mockGrpcClient.Setup(x => x.UpdateTransitionRouteGroup(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); TransitionRouteGroupsClient client = new TransitionRouteGroupsClientImpl(mockGrpcClient.Object, null); TransitionRouteGroup response = client.UpdateTransitionRouteGroup(request.TransitionRouteGroup, request.UpdateMask); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async stt::Task UpdatePageAsync() { moq::Mock <Pages.PagesClient> mockGrpcClient = new moq::Mock <Pages.PagesClient>(moq::MockBehavior.Strict); UpdatePageRequest request = new UpdatePageRequest { Page = new Page(), UpdateMask = new wkt::FieldMask(), }; Page expectedResponse = new Page { PageName = PageName.FromProjectLocationAgentFlowPage("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"), DisplayName = "display_name137f65c2", Form = new Form(), EntryFulfillment = new Fulfillment(), TransitionRoutes = { new TransitionRoute(), }, EventHandlers = { new EventHandler(), }, TransitionRouteGroupsAsTransitionRouteGroupNames = { TransitionRouteGroupName.FromProjectLocationAgentFlowTransitionRouteGroup("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"), }, }; mockGrpcClient.Setup(x => x.UpdatePageAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <Page>(stt::Task.FromResult(expectedResponse), null, null, null, null)); PagesClient client = new PagesClientImpl(mockGrpcClient.Object, null); Page responseCallSettings = await client.UpdatePageAsync(request.Page, request.UpdateMask, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); Page responseCancellationToken = await client.UpdatePageAsync(request.Page, request.UpdateMask, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public void CreateTransitionRouteGroupRequestObject() { moq::Mock <TransitionRouteGroups.TransitionRouteGroupsClient> mockGrpcClient = new moq::Mock <TransitionRouteGroups.TransitionRouteGroupsClient>(moq::MockBehavior.Strict); CreateTransitionRouteGroupRequest request = new CreateTransitionRouteGroupRequest { ParentAsFlowName = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"), TransitionRouteGroup = new TransitionRouteGroup(), LanguageCode = "language_code2f6c7160", }; TransitionRouteGroup expectedResponse = new TransitionRouteGroup { TransitionRouteGroupName = TransitionRouteGroupName.FromProjectLocationAgentFlowTransitionRouteGroup("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"), DisplayName = "display_name137f65c2", TransitionRoutes = { new TransitionRoute(), }, }; mockGrpcClient.Setup(x => x.CreateTransitionRouteGroup(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); TransitionRouteGroupsClient client = new TransitionRouteGroupsClientImpl(mockGrpcClient.Object, null); TransitionRouteGroup response = client.CreateTransitionRouteGroup(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void UpdatePage() { moq::Mock <Pages.PagesClient> mockGrpcClient = new moq::Mock <Pages.PagesClient>(moq::MockBehavior.Strict); UpdatePageRequest request = new UpdatePageRequest { Page = new Page(), UpdateMask = new wkt::FieldMask(), }; Page expectedResponse = new Page { PageName = PageName.FromProjectLocationAgentFlowPage("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"), DisplayName = "display_name137f65c2", Form = new Form(), EntryFulfillment = new Fulfillment(), TransitionRoutes = { new TransitionRoute(), }, EventHandlers = { new EventHandler(), }, TransitionRouteGroupsAsTransitionRouteGroupNames = { TransitionRouteGroupName.FromProjectLocationAgentFlowTransitionRouteGroup("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"), }, }; mockGrpcClient.Setup(x => x.UpdatePage(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); PagesClient client = new PagesClientImpl(mockGrpcClient.Object, null); Page response = client.UpdatePage(request.Page, request.UpdateMask); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for GetTransitionRouteGroup</summary> public void GetTransitionRouteGroupResourceNames() { // Snippet: GetTransitionRouteGroup(TransitionRouteGroupName, CallSettings) // Create client TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.Create(); // Initialize request argument(s) TransitionRouteGroupName name = TransitionRouteGroupName.FromProjectLocationAgentFlowTransitionRouteGroup("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"); // Make the request TransitionRouteGroup response = transitionRouteGroupsClient.GetTransitionRouteGroup(name); // End snippet }
/// <summary>Snippet for DeleteTransitionRouteGroupAsync</summary> public async Task DeleteTransitionRouteGroupResourceNamesAsync() { // Snippet: DeleteTransitionRouteGroupAsync(TransitionRouteGroupName, CallSettings) // Additional: DeleteTransitionRouteGroupAsync(TransitionRouteGroupName, CancellationToken) // Create client TransitionRouteGroupsClient transitionRouteGroupsClient = await TransitionRouteGroupsClient.CreateAsync(); // Initialize request argument(s) TransitionRouteGroupName name = TransitionRouteGroupName.FromProjectLocationAgentFlowTransitionRouteGroup("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"); // Make the request await transitionRouteGroupsClient.DeleteTransitionRouteGroupAsync(name); // End snippet }
/// <summary>Snippet for GetTransitionRouteGroup</summary> public void GetTransitionRouteGroupRequestObject() { // Snippet: GetTransitionRouteGroup(GetTransitionRouteGroupRequest, CallSettings) // Create client TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.Create(); // Initialize request argument(s) GetTransitionRouteGroupRequest request = new GetTransitionRouteGroupRequest { TransitionRouteGroupName = TransitionRouteGroupName.FromProjectLocationAgentFlowTransitionRouteGroup("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"), LanguageCode = "", }; // Make the request TransitionRouteGroup response = transitionRouteGroupsClient.GetTransitionRouteGroup(request); // End snippet }
public void DeleteTransitionRouteGroupResourceNames() { moq::Mock <TransitionRouteGroups.TransitionRouteGroupsClient> mockGrpcClient = new moq::Mock <TransitionRouteGroups.TransitionRouteGroupsClient>(moq::MockBehavior.Strict); DeleteTransitionRouteGroupRequest request = new DeleteTransitionRouteGroupRequest { TransitionRouteGroupName = TransitionRouteGroupName.FromProjectLocationAgentFlowTransitionRouteGroup("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeleteTransitionRouteGroup(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); TransitionRouteGroupsClient client = new TransitionRouteGroupsClientImpl(mockGrpcClient.Object, null); client.DeleteTransitionRouteGroup(request.TransitionRouteGroupName); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for DeleteTransitionRouteGroup</summary> public void DeleteTransitionRouteGroupRequestObject() { // Snippet: DeleteTransitionRouteGroup(DeleteTransitionRouteGroupRequest, CallSettings) // Create client TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.Create(); // Initialize request argument(s) DeleteTransitionRouteGroupRequest request = new DeleteTransitionRouteGroupRequest { TransitionRouteGroupName = TransitionRouteGroupName.FromProjectLocationAgentFlowTransitionRouteGroup("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"), Force = false, }; // Make the request transitionRouteGroupsClient.DeleteTransitionRouteGroup(request); // End snippet }
public async stt::Task DeleteTransitionRouteGroupResourceNamesAsync() { moq::Mock <TransitionRouteGroups.TransitionRouteGroupsClient> mockGrpcClient = new moq::Mock <TransitionRouteGroups.TransitionRouteGroupsClient>(moq::MockBehavior.Strict); DeleteTransitionRouteGroupRequest request = new DeleteTransitionRouteGroupRequest { TransitionRouteGroupName = TransitionRouteGroupName.FromProjectLocationAgentFlowTransitionRouteGroup("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeleteTransitionRouteGroupAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <wkt::Empty>(stt::Task.FromResult(expectedResponse), null, null, null, null)); TransitionRouteGroupsClient client = new TransitionRouteGroupsClientImpl(mockGrpcClient.Object, null); await client.DeleteTransitionRouteGroupAsync(request.TransitionRouteGroupName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); await client.DeleteTransitionRouteGroupAsync(request.TransitionRouteGroupName, st::CancellationToken.None); mockGrpcClient.VerifyAll(); }