public void GetExpandedLandingPageView() { moq::Mock <ExpandedLandingPageViewService.ExpandedLandingPageViewServiceClient> mockGrpcClient = new moq::Mock <ExpandedLandingPageViewService.ExpandedLandingPageViewServiceClient>(moq::MockBehavior.Strict); GetExpandedLandingPageViewRequest request = new GetExpandedLandingPageViewRequest { ResourceNameAsExpandedLandingPageViewName = gagvr::ExpandedLandingPageViewName.FromCustomerExpandedFinalUrlFingerprint("[CUSTOMER_ID]", "[EXPANDED_FINAL_URL_FINGERPRINT]"), }; gagvr::ExpandedLandingPageView expectedResponse = new gagvr::ExpandedLandingPageView { ResourceNameAsExpandedLandingPageViewName = gagvr::ExpandedLandingPageViewName.FromCustomerExpandedFinalUrlFingerprint("[CUSTOMER_ID]", "[EXPANDED_FINAL_URL_FINGERPRINT]"), ExpandedFinalUrl = "expanded_final_url4339aa97", }; mockGrpcClient.Setup(x => x.GetExpandedLandingPageView(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); ExpandedLandingPageViewServiceClient client = new ExpandedLandingPageViewServiceClientImpl(mockGrpcClient.Object, null); gagvr::ExpandedLandingPageView response = client.GetExpandedLandingPageView(request.ResourceName); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void GetExpandedLandingPageView() { Mock <ExpandedLandingPageViewService.ExpandedLandingPageViewServiceClient> mockGrpcClient = new Mock <ExpandedLandingPageViewService.ExpandedLandingPageViewServiceClient>(MockBehavior.Strict); GetExpandedLandingPageViewRequest expectedRequest = new GetExpandedLandingPageViewRequest { ResourceName = new ExpandedLandingPageViewName("[CUSTOMER]", "[EXPANDED_LANDING_PAGE_VIEW]").ToString(), }; ExpandedLandingPageView expectedResponse = new ExpandedLandingPageView { ResourceName = "resourceName2625949903", }; mockGrpcClient.Setup(x => x.GetExpandedLandingPageView(expectedRequest, It.IsAny <CallOptions>())) .Returns(expectedResponse); ExpandedLandingPageViewServiceClient client = new ExpandedLandingPageViewServiceClientImpl(mockGrpcClient.Object, null); string formattedResourceName = new ExpandedLandingPageViewName("[CUSTOMER]", "[EXPANDED_LANDING_PAGE_VIEW]").ToString(); ExpandedLandingPageView response = client.GetExpandedLandingPageView(formattedResourceName); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }