示例#1
0
        public void TestMergeResultOfResultWorks()
        {
            var result = new ParseResult <object>();

            var obj = new object();

            result.MergeResult(obj);

            result.AssertNoErrors();

            Assert.Empty(result.Errors);

            Assert.Same(obj, result.Result);
        }
示例#2
0
        public void TestMergeResultOfCommandResultWorks()
        {
            var result = new ParseResult <object>();

            var mockCmdResult = new Mock <ICommandParserResult>();

            mockCmdResult.SetupGet(x => x.HasErrors).Returns(false);
            mockCmdResult.SetupGet(x => x.Errors).Returns(new List <Exception>());

            result.MergeResult(mockCmdResult.Object);

            mockCmdResult.VerifyGet(x => x.HasErrors);

            result.AssertNoErrors();
        }