Esempio n. 1
0
        public void BatchUndeleteAlertsRequestObject()
        {
            moq::Mock <AlertCenterService.AlertCenterServiceClient> mockGrpcClient = new moq::Mock <AlertCenterService.AlertCenterServiceClient>(moq::MockBehavior.Strict);
            BatchUndeleteAlertsRequest request = new BatchUndeleteAlertsRequest
            {
                CustomerId = "customer_id3b3724cb",
                AlertId    =
                {
                    "alert_idc6c58cd5",
                },
            };
            BatchUndeleteAlertsResponse expectedResponse = new BatchUndeleteAlertsResponse
            {
                SuccessAlertIds =
                {
                    "success_alert_ids0aeac317",
                },
                FailedAlertStatus =
                {
                    {
                        "key8a0b6e3c",
                        new gr::Status()
                    },
                },
            };

            mockGrpcClient.Setup(x => x.BatchUndeleteAlerts(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            AlertCenterServiceClient    client   = new AlertCenterServiceClientImpl(mockGrpcClient.Object, null);
            BatchUndeleteAlertsResponse response = client.BatchUndeleteAlerts(request);

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