Ejemplo n.º 1
0
        /// <summary>
        /// Loads the test suite for this run.
        /// </summary>
        /// <param name="suiteName"> The name of the suite to load</param>
        /// <param name="continuation">The function to call after the suite is loaded</param>
        public virtual void LoadTestSuite(string suiteName, Action <TestSuite, TestModuleData> continuation)
        {
#if !WIN8
            string suiteFileName = Path.GetFullPath(suiteName);

            TestSuite suite;
            if (Path.GetExtension(suiteName).Equals(".dll", StringComparison.OrdinalIgnoreCase))
            {
                suite = new TestSuite();
                suite.Assemblies.Add(Path.GetFileNameWithoutExtension(suiteName));
            }
            else
            {
                using (XmlReader reader = XmlReader.Create(suiteFileName))
                {
                    suite = TestSuiteUtilities.LoadFrom(reader);
                }
            }

            string assemblyDirectory = Path.GetDirectoryName(suiteFileName);
            LoadTestSuite(suite, continuation, assemblyDirectory);
#else
            throw new NotImplementedException("TODO: load the suite ahead of time from public documents, then call the overload of LoadTestSuite that takes a TestSuite argument");
#endif
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Loads the test suite for this run.
        /// </summary>
        /// <param name="suiteName"> The name of the suite to load</param>
        /// <param name="continuation">The function to call after the suite is loaded</param>
        public virtual void LoadTestSuite(string suiteName, Action <TestSuite, TestModuleData> continuation)
        {
            string suiteFileName = Path.GetFullPath(suiteName);

            TestSuite suite;

            if (Path.GetExtension(suiteName).Equals(".dll", StringComparison.OrdinalIgnoreCase))
            {
                suite = new TestSuite();
                suite.Assemblies.Add(Path.GetFileNameWithoutExtension(suiteName));
            }
            else
            {
                using (XmlReader reader = XmlReader.Create(suiteFileName))
                {
                    suite = TestSuiteUtilities.LoadFrom(reader);
                }
            }

            string assemblyDirectory = Path.GetDirectoryName(suiteFileName);

            LoadTestSuite(suite, continuation, assemblyDirectory);
        }