public static ScenarioDirectory Create(string scenario)
        {
            var name = Path.Combine(rootDirectory, scenario);

            FileSystem.EnsureDirectoryDeleted(name);
            FileSystem.EnsureDirectoryCreated(name);
            return(new ScenarioDirectory(name));
        }
Exemple #2
0
        private ScriptFile(string scenario, bool createWorkingDirectory)
        {
            File.Delete(this.path = Path.Combine(directory, this.name = string.Concat(scenario, ".csx")));
            File.Delete(this.log  = Path.Combine(directory, string.Concat(scenario, ".log")));

            if (createWorkingDirectory)
            {
                FileSystem.EnsureDirectoryDeleted(Path.Combine(directory, scenario));
                FileSystem.EnsureDirectoryCreated(Path.Combine(directory, scenario));
            }
        }
Exemple #3
0
        public ScenarioDirectory WriteLine(string fileName, string text)
        {
            fileName = Map(fileName);
            FileSystem.EnsureDirectoryCreated(Path.GetDirectoryName(fileName));
            using (var writer = new StreamWriter(fileName, true))
            {
                writer.WriteLine(text);
                writer.Flush();
            }

            return(this);
        }
        public static ScenarioDirectory Create(string scenario)
        {
            var name = Path.Combine(rootDirectory, scenario);

            if (name == null)
            {
                throw new Exception("Invalid directory");
            }
            Debug.WriteLine($"Scenarios Dir [{name.Length}]: {name}");
            FileSystem.EnsureDirectoryDeleted(name);
            FileSystem.EnsureDirectoryCreated(name);
            return(new ScenarioDirectory(name));
        }
Exemple #5
0
 static ScriptFile()
 {
     FileSystem.EnsureDirectoryCreated(directory);
 }