Beispiel #1
0
        public void Setup()
        {
            Framework.Settings.TempPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "TestTempDir");

            if (!Directory.Exists(Framework.Settings.TempPath))
            {
                Directory.CreateDirectory(Framework.Settings.TempPath);
            }
            else
            {
                Framework.CleanTempDir();
            }

            OMODFile        = Path.Combine(Framework.Settings.TempPath, "ILoveTesting.omod");
            ModFiles        = new List <string>();
            FolderStructure = new List <string>();

            if (File.Exists("readme.txt"))
            {
                Readme = File.ReadAllText("readme.txt");
            }

            if (File.Exists("script.txt"))
            {
                Script = File.ReadAllText("script.txt");
            }

            Directory.GetFiles("files", "*", SearchOption.AllDirectories).Do(f =>
            {
                ModFiles.Add(f);
                FolderStructure.Add(f.Substring("files\\".Length));
            });
        }
Beispiel #2
0
        public void Cleanup()
        {
            Framework.CleanTempDir(true);

#if DELETEFILES
            if (File.Exists("hello.txt"))
            {
                File.Delete("hello.txt");
            }
            if (File.Exists("hello.zip"))
            {
                File.Delete("hello.zip");
            }
            if (File.Exists("hello_out.txt"))
            {
                File.Delete("hello_out.txt");
            }
#endif
        }