コード例 #1
0
        public void TestSanity()
        {
            IParser parser = new XmlParser();

            parser.Parse("..\\..\\src\\Test\\Sanity\\sanity.xml");
            if (!parser.IsValid)
            {
                foreach (String s in parser.Log)
                {
                    Console.Out.WriteLine(s);
                }
            }
            else
            {
                IGenerator gen = new NVelocityGenerator();
                if (Directory.Exists(@".\SanityTest"))
                {
                    Directory.Delete(@".\SanityTest", true);
                }
                gen.Generate(parser);
                foreach (String s in gen.Log)
                {
                    Console.Out.WriteLine(s);
                }

                CompareResults("..\\..\\src\\Test\\Sanity");
            }
        }
コード例 #2
0
        private void Execute(String root, String configFilename, String outputPath)
        {
            IParser parser = new XmlParser();

            parser.Parse(configFilename);
            if (!parser.IsValid)
            {
                String message = String.Empty;
                foreach (String s in parser.Log)
                {
                    Console.Out.WriteLine(s);
                    message += s + "\n";
                }
                Assert.Fail(message);
            }
            else
            {
                IGenerator gen = new NVelocityGenerator();
                if (Directory.Exists(outputPath))
                {
                    Directory.Delete(outputPath, true);
                }
                gen.Generate(parser);
                String message = String.Empty;
                foreach (String s in gen.Log)
                {
                    Console.Out.WriteLine(s);
                    message += s + "\n";
                }

                if (message.IndexOf("ERROR") >= 0)
                {
                    Assert.Fail(message);
                }

                CompareResults(root, outputPath);
            }
        }