Exemple #1
0
        public void GetPageRequestObject()
        {
            moq::Mock <Pages.PagesClient> mockGrpcClient = new moq::Mock <Pages.PagesClient>(moq::MockBehavior.Strict);
            GetPageRequest request = new GetPageRequest
            {
                PageName     = PageName.FromProjectLocationAgentFlowPage("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"),
                LanguageCode = "language_code2f6c7160",
            };
            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.GetPage(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            PagesClient client   = new PagesClientImpl(mockGrpcClient.Object, null);
            Page        response = client.GetPage(request);

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