public void ListPlannableProducts2()
        {
            Mock <ReachPlanService.ReachPlanServiceClient> mockGrpcClient = new Mock <ReachPlanService.ReachPlanServiceClient>(MockBehavior.Strict);
            ListPlannableProductsRequest request = new ListPlannableProductsRequest
            {
                PlannableLocationId = null,
            };
            ListPlannableProductsResponse expectedResponse = new ListPlannableProductsResponse();

            mockGrpcClient.Setup(x => x.ListPlannableProducts(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            ReachPlanServiceClient        client   = new ReachPlanServiceClientImpl(mockGrpcClient.Object, null);
            ListPlannableProductsResponse response = client.ListPlannableProducts(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
示例#2
0
        public void ListPlannableProductsRequestObject()
        {
            moq::Mock <ReachPlanService.ReachPlanServiceClient> mockGrpcClient = new moq::Mock <ReachPlanService.ReachPlanServiceClient>(moq::MockBehavior.Strict);
            ListPlannableProductsRequest request = new ListPlannableProductsRequest
            {
                PlannableLocationId = "plannable_location_idbae428fa",
            };
            ListPlannableProductsResponse expectedResponse = new ListPlannableProductsResponse
            {
                ProductMetadata =
                {
                    new ProductMetadata(),
                },
            };

            mockGrpcClient.Setup(x => x.ListPlannableProducts(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            ReachPlanServiceClient        client   = new ReachPlanServiceClientImpl(mockGrpcClient.Object, null);
            ListPlannableProductsResponse response = client.ListPlannableProducts(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }