public void FileRun_LetterFile_ThrowsException() { var file = new File("symitar", "10", "RandomFile", FileType.Letter, DateTime.Now, 10); var mockSocket = Substitute.For<ISymSocket>(); var session = new SymSession(mockSocket, 10); Assert.Throws<InvalidOperationException>(() => session.FileRun(file, null, null, -1)); }
public void FileRun_LetterFile_ThrowsException() { var file = new File("symitar", "10", "RandomFile", FileType.Letter, DateTime.Now, 10); var mockSocket = Substitute.For <ISymSocket>(); var session = new SymSession(mockSocket, 10); Assert.Throws <InvalidOperationException>(() => session.FileRun(file, null, null, -1)); }
private void RunReportTest(string fileName) { var file = new File { Name = fileName, Type = FileType.RepGen }; RepgenRunResult result = _session.FileRun(file, (code, description) => responseBox.Text += string.Format("{0}: {1}\n", code, description), prompt => "", 3, JobComplete); }
//======================================================================== private void btnRun_Click(object sender, EventArgs e) { int queue = -1; if (optUserSelect.Checked) { queue = int.Parse(txtQueue.Text); } if (chkQueueAlways.Checked == true) { Config.SetValue("Default_Queue", txtQueue.Text, true); } btnRun.Enabled = false; RepRunErr rre = session.FileRun(specfile, StatusUpdate, PromptInput, queue); switch (rre.code) { case RepRunErr.Status.CANCELLED: Close(); return; case RepRunErr.Status.NOTFOUND: MessageBox.Show("Error Running File \"" + specfile.name + "\"\nFile Not Found", "Run Report", MessageBoxButtons.OK, MessageBoxIcon.Error); Close(); return; case RepRunErr.Status.ERRORED: MessageBox.Show("Error Running File \"" + specfile.name + "\"\nError: \"" + rre.err + '\"', "Run Report", MessageBoxButtons.OK, MessageBoxIcon.Error); Close(); return; } //RepRunErr.Status.OKAY: sequence = rre.sequence; time = rre.time; running = true; mod = 0; checker.RunWorkerAsync(); }