public void DeleteAllContextsResourceNames()
        {
            moq::Mock <Contexts.ContextsClient> mockGrpcClient = new moq::Mock <Contexts.ContextsClient>(moq::MockBehavior.Strict);
            DeleteAllContextsRequest            request        = new DeleteAllContextsRequest
            {
                ParentAsSessionName = SessionName.FromProjectSession("[PROJECT]", "[SESSION]"),
            };
            wkt::Empty expectedResponse = new wkt::Empty {
            };

            mockGrpcClient.Setup(x => x.DeleteAllContexts(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            ContextsClient client = new ContextsClientImpl(mockGrpcClient.Object, null);

            client.DeleteAllContexts(request.ParentAsSessionName);
            mockGrpcClient.VerifyAll();
        }
Example #2
0
        public void DeleteAllContextsRequestObject()
        {
            moq::Mock <Contexts.ContextsClient> mockGrpcClient = new moq::Mock <Contexts.ContextsClient>(moq::MockBehavior.Strict);
            DeleteAllContextsRequest            request        = new DeleteAllContextsRequest
            {
                Parent = "parent7858e4d0",
            };
            wkt::Empty expectedResponse = new wkt::Empty {
            };

            mockGrpcClient.Setup(x => x.DeleteAllContexts(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            ContextsClient client = new ContextsClientImpl(mockGrpcClient.Object, null);

            client.DeleteAllContexts(request);
            mockGrpcClient.VerifyAll();
        }
Example #3
0
        public void DeleteAllContexts2()
        {
            Mock <Contexts.ContextsClient> mockGrpcClient = new Mock <Contexts.ContextsClient>(MockBehavior.Strict);
            DeleteAllContextsRequest       request        = new DeleteAllContextsRequest
            {
                ParentAsSessionName = new SessionName("[PROJECT]", "[SESSION]"),
            };
            Empty expectedResponse = new Empty();

            mockGrpcClient.Setup(x => x.DeleteAllContexts(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            ContextsClient client = new ContextsClientImpl(mockGrpcClient.Object, null);

            client.DeleteAllContexts(request);
            mockGrpcClient.VerifyAll();
        }