Esempio n. 1
0
        public async stt::Task DeleteAlertRequestObjectAsync()
        {
            moq::Mock <AlertCenterService.AlertCenterServiceClient> mockGrpcClient = new moq::Mock <AlertCenterService.AlertCenterServiceClient>(moq::MockBehavior.Strict);
            DeleteAlertRequest request = new DeleteAlertRequest
            {
                CustomerId = "customer_id3b3724cb",
                AlertId    = "alert_idc6c58cd5",
            };
            wkt::Empty expectedResponse = new wkt::Empty {
            };

            mockGrpcClient.Setup(x => x.DeleteAlertAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <wkt::Empty>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            AlertCenterServiceClient client = new AlertCenterServiceClientImpl(mockGrpcClient.Object, null);
            await client.DeleteAlertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            await client.DeleteAlertAsync(request, st::CancellationToken.None);

            mockGrpcClient.VerifyAll();
        }