public void AppendNumberToGivenPathIfAlreadyExists() { // Arrange var o = new Orchestrator(); string baseName = @"TT" + new Random().Next().ToString(); var dirs = new List <string> { baseName, baseName + "_0", baseName + "_1" }; foreach (var dir in dirs) { Directory.CreateDirectory(dir); File.Create(dir + Path.DirectorySeparatorChar + "test").Dispose(); } // Act o.Orchestrate($"-i rep1.bed -i rep2.bed -r bio -w 1E-2 -s 1E-8 -o {dirs[0]}".Split(' ')); // Assert Assert.Equal(o.OutputPath, dirs[0] + "_2"); // Clean up o.Dispose(); foreach (var dir in dirs) { Directory.Delete(dir, true); } Directory.Delete(dirs[0] + "_2", true); }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { try { orchestrator.Dispose(); } catch (Exception ex) { //Eat it } }
public override void OnStop() { _orchestrator.Stop(); _orchestrator.Dispose(); base.OnStop(); }