void ParseArguments(string[] args) { try { for (int i = 0; i < args.Length; i += 2) { string key = args[i].ToLower(); string value = args[i + 1]; if (key == "-p" || key == "-path") { SolutionPath = value; } if (key == "-d" || key == "-display") { RunnerDisplay.Add(value); } if (key == "-t" || key == "-test") { TestRunner.Add(value); } if (key == "-b" || key == "-builder") { Builder = value; } } } catch (Exception ex) { throw new ArgumentException("Arguments invalid", ex); } }
void SetDefaults() { if (string.IsNullOrWhiteSpace(SolutionPath)) { SolutionPath = GetSolutionFilePath(Directory.GetCurrentDirectory()); } if (RunnerDisplay.Count == 0) { RunnerDisplay.Add(ConfigurationManager.AppSettings["RunnerDisplay"]); } if (TestRunner.Count == 0) { string[] testRunners = ConfigurationManager.AppSettings["TestRunner"].Split(','); foreach (var runner in testRunners) { TestRunner.Add(runner); } } if (string.IsNullOrWhiteSpace(Builder)) { Builder = ConfigurationManager.AppSettings["Builder"]; } }