public void WaitInstruction() { var wait = new Program.WaitInstruction("4"); wait.Execute(this.process, this.mock.Action, new List <string>()); List <string> processes = this.getProcesses(); Assert.AreEqual(2, processes.Count); Assert.IsTrue(processes.Any(s => s.Contains("ar-wait"))); foreach (int i in Enumerable.Range(0, 3)) { this.tick(); } processes = this.getProcesses(); Assert.AreEqual(2, processes.Count); Assert.IsFalse(this.mock.Called); Assert.IsTrue(processes.Any(s => s.Contains("ar-wait"))); this.tick(); processes = this.getProcesses(); Assert.AreEqual(1, processes.Count); Assert.IsTrue(this.mock.Called); Assert.IsFalse(processes.Any(s => s.Contains("ar-wait"))); }
public void KillWaitInstruction() { var wait = new Program.WaitInstruction("1"); wait.Execute(this.process, this.mock.Action, new List <string>()); Assert.IsFalse(this.mock.Called); this.manager.KillAll("ar-wait"); Assert.IsTrue(this.mock.Called); this.tick(); Assert.AreEqual(1, this.mock.CallCount); }
string getTime(Program.WaitInstruction i) => this.get(i, "time") as string;