예제 #1
0
        public void CreatePageResourceNames()
        {
            moq::Mock <Pages.PagesClient> mockGrpcClient = new moq::Mock <Pages.PagesClient>(moq::MockBehavior.Strict);
            CreatePageRequest             request        = new CreatePageRequest
            {
                ParentAsFlowName = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"),
                Page             = new Page(),
            };
            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.CreatePage(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            PagesClient client   = new PagesClientImpl(mockGrpcClient.Object, null);
            Page        response = client.CreatePage(request.ParentAsFlowName, request.Page);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }