예제 #1
0
        static public void BuildTree(HtmlTestFilesFixture fixture, string name) {
            string testFile = fixture.GetDestinationPath(name);
            string baselineFile = testFile + ".tree";
            string text = fixture.LoadDestinationFile(name);

            var tree = new HtmlTree(new TextStream(text), null, null, ParsingMode.Html);
            tree.Build();

            TreeWriter tw = new TreeWriter();
            string actual = tw.WriteTree(tree);

            if (_regenerateBaselineFiles) {
                // Update this to your actual enlistment if you need to update baseline
                baselineFile = Path.Combine(fixture.SourcePath, name) + ".tree";
                TestFiles.UpdateBaseline(baselineFile, actual);
            } else {
                TestFiles.CompareToBaseLine(baselineFile, actual);
            }
        }
예제 #2
0
        static public void ParseText(HtmlTestFilesFixture fixture, string name) {
            string testFile = fixture.GetDestinationPath(name);
            string baselineFile = testFile + ".log";
            string text = fixture.LoadDestinationFile(name);
            EventLogger logger = null;

            HtmlParser p = new HtmlParser();
            logger = new EventLogger(p);
            p.Parse(text);
            var actual = logger.ToString();

            if (_regenerateBaselineFiles) {
                // Update this to your actual enlistment if you need to update baseline
                baselineFile = Path.Combine(fixture.SourcePath, name) + ".log";
                TestFiles.UpdateBaseline(baselineFile, actual);
            } else {
                TestFiles.CompareToBaseLine(baselineFile, actual);
            }
        }