void WriteRerunFile(nStepOptions options) { FileInfo fi = new FileInfo(AppDomain.CurrentDomain.BaseDirectory + "rerun.dat"); Stream stream = File.Open(fi.ToString(), FileMode.Create); BinaryFormatter bFormatter = new BinaryFormatter(); bFormatter.Serialize(stream, options); stream.Close(); }
private void Run(string[] args) { Options = new nStepOptions().Parse<nStepOptions>(args); if (Options.Debug) { Console.WriteLine("Please attach the .Net debugger to continue..."); int seconds = 0; while (!System.Diagnostics.Debugger.IsAttached) { Thread.Sleep(1000); seconds += 1; if (seconds > 60) return; } Console.Clear(); } if (Options.Rerun) Options = ReadRerunFile(); WriteRerunFile(Options); AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; formatter = new ConsoleOutputFormatter("nStep", new CSharpSyntaxSuggester()); InitializeThenRun(Options.Assemblies.Select(x => new FileInfo(x)).ToList(), ()=>LoadAndExecuteFeatureFile(Options.FeatureFiles)); formatter.WriteResults(StepMother); }