Ejemplo n.º 1
0
        /// <summary>
        /// Assures that the results directory exists.  If the results directory
        /// cannot be created, fails the test.
        /// </summary>
        protected internal static void  assureResultsDirectoryExists(System.String resultsDirectory)
        {
            System.IO.FileInfo dir = new System.IO.FileInfo(resultsDirectory);
            bool tmpBool;

            if (System.IO.File.Exists(dir.FullName))
            {
                tmpBool = true;
            }
            else
            {
                tmpBool = System.IO.Directory.Exists(dir.FullName);
            }
            if (!tmpBool)
            {
                RuntimeSingleton.info("Template results directory does not exist");
                Boolean ok = true;
                try {
                    System.IO.Directory.CreateDirectory(dir.FullName);
                } catch (System.Exception ex) {
                    ok = false;
                }

                if (ok)
                {
                    RuntimeSingleton.info("Created template results directory");
                }
                else
                {
                    System.String errMsg = "Unable to create template results directory";
                    RuntimeSingleton.warn(errMsg);
                    Assertion.Fail(errMsg);
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Log an info message.
 /// </summary>
 /// <param name="Object">message to log</param>
 public static void Info(Object message)
 {
     RuntimeSingleton.info(message);
 }