コード例 #1
0
        public void DeleteEvents()
        {
            moq::Mock <ErrorStatsService.ErrorStatsServiceClient> mockGrpcClient = new moq::Mock <ErrorStatsService.ErrorStatsServiceClient>(moq::MockBehavior.Strict);
            DeleteEventsRequest request = new DeleteEventsRequest
            {
                ProjectNameAsProjectName = new gagr::ProjectName("[PROJECT]"),
            };
            DeleteEventsResponse expectedResponse = new DeleteEventsResponse {
            };

            mockGrpcClient.Setup(x => x.DeleteEvents(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            ErrorStatsServiceClient client   = new ErrorStatsServiceClientImpl(mockGrpcClient.Object, null);
            DeleteEventsResponse    response = client.DeleteEvents(request.ProjectName);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void DeleteEvents2()
        {
            Mock <ErrorStatsService.ErrorStatsServiceClient> mockGrpcClient = new Mock <ErrorStatsService.ErrorStatsServiceClient>(MockBehavior.Strict);
            DeleteEventsRequest request = new DeleteEventsRequest
            {
                ProjectNameAsProjectName = new ProjectName("[PROJECT]"),
            };
            DeleteEventsResponse expectedResponse = new DeleteEventsResponse();

            mockGrpcClient.Setup(x => x.DeleteEvents(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            ErrorStatsServiceClient client   = new ErrorStatsServiceClientImpl(mockGrpcClient.Object, null);
            DeleteEventsResponse    response = client.DeleteEvents(request);

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