public void Parse_WorkUnitThrowsException_SaveToExceptionProperty()
        {
            var tree = new WorkUnitTree(new WuRoot());

            tree.AddNextNode(new WorkUnitTree(new Wu1()))
            .AddNextNode(new WorkUnitTree(new WorkUnitException()))
            .AddNextNode(new WorkUnitTree(new Wu2()));

            var parser = new WebSiteParser <IWorkUnit, ParserExecutorResult>(tree);

            var result = parser.Parse(new In {
                Id = "1"
            });

            var expected = JsonConvert.SerializeObject(new {
                UnitName = "WorkUnitException",
                Message  = "Exception in work unit",
                Path     = "WuRoot > Wu1 > WorkUnitException > "
            });

            Assert.AreEqual(expected, result.Exception);
        }
Esempio n. 2
0
        public void Parse_ExecutionPaths_CorrectUnitsPassed(ExecutionPath path, string expected)
        {
            var result = parser.Parse(new TestWorkUnitModel(path));

            Assert.AreEqual(expected, result.ExecutionPath);
        }