Example #1
0
        public void DeleteContextRequestObject()
        {
            moq::Mock <Contexts.ContextsClient> mockGrpcClient = new moq::Mock <Contexts.ContextsClient>(moq::MockBehavior.Strict);
            DeleteContextRequest request = new DeleteContextRequest
            {
                ContextName = ContextName.FromProjectSessionContext("[PROJECT]", "[SESSION]", "[CONTEXT]"),
            };
            wkt::Empty expectedResponse = new wkt::Empty {
            };

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

            client.DeleteContext(request);
            mockGrpcClient.VerifyAll();
        }
Example #2
0
        public void DeleteContext2()
        {
            Mock <Contexts.ContextsClient> mockGrpcClient = new Mock <Contexts.ContextsClient>(MockBehavior.Strict);
            DeleteContextRequest           request        = new DeleteContextRequest
            {
                ContextName = new ContextName("[PROJECT]", "[SESSION]", "[CONTEXT]"),
            };
            Empty expectedResponse = new Empty();

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

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