/// <summary> /// Pop a dispatcher off the stack. /// </summary> /// <returns>Returns the top-most container. Throws an /// InvalidOperationException if none is available.</returns> public ICompositeWorkItem Pop() { if (CurrentCompositeWorkItem == null) { throw new InvalidOperationException(Properties.UnitTestMessage.UnitTestHarness_RunNextStep_NoCompositeWorkItemsExist); } ICompositeWorkItem queue = _stack.Peek(); if (queue != null) { _stack.Pop(); } return(queue); }
/// <summary> /// Push a new dispatcher onto the stack. /// </summary> /// <param name="composite">The composite work item to push.</param> public void Push(ICompositeWorkItem composite) { _stack.Push(composite); }
/// <summary> /// Event fired at the completion of the harness' work. /// </summary> /// <param name="sender">Sender object instance.</param> /// <param name="e">Event arguments.</param> private void HarnessComplete(object sender, EventArgs e) { LogWriter.UnitTestHarnessStage(this, HarnessName, TestStage.Finishing); _harnessTasks = null; }
/// <summary> /// Creates the set of harness tasks to run and hooks up to the Complete event. /// </summary> private void CreateHarnessTasks() { _harnessTasks = new CompositeWorkItem(); _harnessTasks.Complete += HarnessComplete; }