Пример #1
0
        public static bool RunSingleTest(string baseUrl, TestInfo ti)
        {
            HtmlDiff wt = new HtmlDiff();

            wt.TestsBaseUrl   = baseUrl;
            wt.IgnoreListFile = _ignoreListFile;

            XmlDocument d1 = new XmlDocument();

            d1.Load(_outputPath + ti.Url.Replace("/", "_") + ".xml");

            XmlDocument d2 = wt.GetTestXml(ti);
            bool        fp = wt.XmlCompare(d1, d2, _disableAlmost);

            if (fp == false)
            {
                throw new Exception("Url: " + ti.Url + "\nCompare failed:\n" + wt.CompareStatus + "\n");
            }
            return(fp);
        }
Пример #2
0
        static void CreateExpectedResults(string baseUrl)
        {
            TestsCatalog tc = new TestsCatalog(_catalogFile, _runExcluded);
            HtmlDiff     wt = new HtmlDiff();

            wt.TestsBaseUrl   = baseUrl;
            wt.IgnoreListFile = _ignoreListFile;

            if ((_outputPath != "") && (!Directory.Exists(_outputPath)))
            {
                Directory.CreateDirectory(_outputPath);
            }

            Console.WriteLine("Running expected results...");
            foreach (TestInfo ti in tc)
            {
                Console.WriteLine("Running...  " + ti.Url);
                XmlDocument d = wt.GetTestXml(ti);
                d.Save(_outputPath + ti.Url.Replace("/", "_") + ".xml");
            }
        }
Пример #3
0
		public static bool RunSingleTest(string baseUrl, TestInfo ti)
		{
			HtmlDiff wt = new HtmlDiff();
			wt.TestsBaseUrl = baseUrl;
			wt.IgnoreListFile = _ignoreListFile;

			XmlDocument d1 = new XmlDocument();
			d1.Load(_outputPath + ti.Url.Replace("/", "_") + ".xml");
			
			XmlDocument d2 = wt.GetTestXml( ti );
			bool fp = wt.XmlCompare(d1, d2, _disableAlmost);
			if (fp == false) {
				throw new Exception("Url: " + ti.Url + "\nCompare failed:\n" + wt.CompareStatus + "\n");
			}
			return fp;
		}
Пример #4
0
		static void CreateExpectedResults(string baseUrl)
		{
			TestsCatalog tc = new TestsCatalog(_catalogFile, _runExcluded);
			HtmlDiff wt = new HtmlDiff();
			wt.TestsBaseUrl = baseUrl;
			wt.IgnoreListFile = _ignoreListFile;

			if ((_outputPath != "") && (!Directory.Exists(_outputPath)))
			{
				Directory.CreateDirectory(_outputPath);
			}

			Console.WriteLine("Running expected results...");
			foreach (TestInfo ti in tc)
			{
				Console.WriteLine("Running...  " + ti.Url);
				XmlDocument d = wt.GetTestXml( ti );
				d.Save(_outputPath + ti.Url.Replace("/", "_") + ".xml");
			}
		}