Ejemplo n.º 1
0
        /// <summary>
        /// Discover a collection of test cases.
        /// </summary>
        /// <param name="discoveryInfoPath">Path to Discovery Info. If path is relative, it will interpreted as relative to the current directory.</param>
        /// <param name="filteringSettings">Filtering settings.</param>
        /// <returns></returns>
        public static TestRecords Discover(FileInfo discoveryInfoPath, FilteringSettings filteringSettings)
        {
            Profiler.StartMethod();

            IEnumerable <TestInfo> testInfos = DiscoveryEngine.Discover(discoveryInfoPath, filteringSettings);
            TestRecords            tests     = new TestRecords();

            foreach (TestInfo testInfo in testInfos)
            {
                TestRecord testRecord = new TestRecord();
                testRecord.TestInfo = testInfo;
                tests.TestCollection.Add(testRecord);
            }
            Profiler.EndMethod();
            return(tests);
        }
Ejemplo n.º 2
0
        public static TestRecords Load(DirectoryInfo serializationDirectory)
        {
            FileInfo resultsFileInfo = new FileInfo(Path.Combine(serializationDirectory.FullName, serializationFileName));

            Profiler.StartMethod();
            TestRecords records = null;

            try
            {
                using (XmlTextReader textReader = new XmlTextReader(resultsFileInfo.OpenRead()))
                {
                    records = (TestRecords)ObjectSerializer.Deserialize(textReader, typeof(TestRecords), null);
                }
            }
            catch (Exception e)
            {
                throw new IOException("Failed to Deserialize: " + resultsFileInfo.FullName, e);
            }
            Profiler.EndMethod();
            return(records);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Produce a comprehensive static xml report from the test results
 /// </summary>
 public void GenerateXmlReport(TestRecords tests, RunInfo runInfo, DirectoryInfo reportRoot, DirectoryInfo testBinariesDirectory)
 {
     Profiler.StartMethod();
     ReportingEngine.GenerateXmlReport(tests, runInfo, reportRoot, testBinariesDirectory);
     Profiler.EndMethod();
 }