public void ShouldFailForMultipleFiles()
 {
     // cheating a bit and using csv instead of config files. Prinicple is the same, though. Should fail if more than one thing matches. This
     // of course assumes there are multiple .csv files. But there are. So we're good.
     var locater = new ProjectConfigurationLocater(Files.Csv.Mathematics, "*.csv");
     string configPath = locater.Locate();
     Assert.AreEqual(Path.GetFullPath(Files.Config.GoodConfig), configPath);
 }
Example #2
0
        private static void Launch(string[] args)
        {
            Info.Intro();
            string inputPath = args[0];

            string configurationFile = new ProjectConfigurationLocater(inputPath, "*monkeyPants.config").Locate();
            ProjectConfiguration configuration = ProjectConfiguration.Load(configurationFile);

            Info.Echo(configurationFile, configuration);

            Session session = configuration.CreateSession();
            session.Run(inputPath);
        }
 public void ShouldLocateExistingProjectConfig()
 {
     var locater = new ProjectConfigurationLocater(Files.Excel2003.MessWithWordsAndMathematics, "*MonkeyPants.config");
     string configPath = locater.Locate();
     Assert.AreEqual(Path.GetFullPath(Files.Config.GoodConfig), configPath);
 }
 public void ShouldFailForNonExistentFile()
 {
     var locater = new ProjectConfigurationLocater(Files.Excel2003.MessWithWordsAndMathematics, "*notThere.config");
     string configPath = locater.Locate();
     Assert.AreEqual(Path.GetFullPath(Files.Config.GoodConfig), configPath);
 }