Beispiel #1
0
        protected void run(string file, int right, int wrong, int ignores, int exceptions)
        {
            string  root    = findRoot(file);
            string  input   = readExample(root + file);
            Fixture fixture = new Fixture();

            Fixture.assemblyDirs = new string[] { ".", @"..\..\..\eg\bin\Debug" };
            Parse tables;

            if (input.IndexOf("<wiki>") >= 0)
            {
                tables = new Parse(input, new String[] { "wiki", "table", "tr", "td" });
                fixture.doTables(tables.parts);
            }
            else
            {
                tables = new Parse(input, new String[] { "table", "tr", "td" });
                fixture.doTables(tables);
            }
            StringWriter output = new StringWriter();

            tables.print(output);
            output.Close();

            Assert.AreEqual(right, fixture.counts.right, file + " right");
            Assert.AreEqual(wrong, fixture.counts.wrong, file + " wrong");
            Assert.AreEqual(ignores, fixture.counts.ignores, file + " ignores");
            Assert.AreEqual(exceptions, fixture.counts.exceptions, file + " exceptions");
        }
Beispiel #2
0
 public virtual void process()
 {
     try {
         tables = new Parse(input);
         fixture.doTables(tables);
     }
     catch (Exception e) {
         exception(e);
     }
     tables.print(output);
 }
Beispiel #3
0
        protected void run(string file, int right, int wrong, int ignores, int exceptions)
        {
            string root = findRoot(file);
            string input = readExample(root + file);
            Fixture fixture = new Fixture();
            Fixture.assemblyDirs = new string[] {".", @"..\..\..\eg\bin\Debug"};
            Parse tables;
            if (input.IndexOf("<wiki>") >= 0)
            {
                tables = new Parse(input, new String[]{"wiki", "table", "tr", "td"});
                fixture.doTables(tables.parts);
            }
            else
            {
                tables = new Parse(input, new String[]{"table", "tr", "td"});
                fixture.doTables(tables);
            }
            StringWriter output = new StringWriter();
            tables.print(output);
            output.Close();

            Assert.AreEqual(right, fixture.counts.right, file+" right");
            Assert.AreEqual(wrong, fixture.counts.wrong, file+" wrong");
            Assert.AreEqual(ignores, fixture.counts.ignores, file+" ignores");
            Assert.AreEqual(exceptions, fixture.counts.exceptions, file+" exceptions");
        }