public void CorrectAdvanceStepForCompletedStep() { // Arrange Description description = new Description("Take the Key."); Duration expected = new Duration(1000); Duration limit = new Duration(2000); Interaction interaction = new Interaction(Act.Grab, description, expected, limit); LeafStep leafStep = new LeafStep(Standard.Mandatory, "Taking Key", interaction); // Act leafStep.AdvanceStep(DateTime.Now); leafStep.AdvanceStep(DateTime.Now); leafStep.AdvanceStep(DateTime.Now); }
public void CorrectExecutionTimeOnCompletion() { // Arrange Description description = new Description("Take the Key."); Duration expected = new Duration(1000); Duration limit = new Duration(2000); Interaction interaction = new Interaction(Act.Grab, description, expected, limit); LeafStep leafStep = new LeafStep(Standard.Mandatory, "Taking Key", interaction); DateTime firstTime = DateTime.Now; DateTime secondTime = DateTime.Now; // Act leafStep.AdvanceStep(firstTime); leafStep.AdvanceStep(secondTime); // Assert Assert.AreEqual(secondTime.Subtract(firstTime).TotalSeconds, leafStep.ExecutionTime.Seconds); }
public void CorrectAdvanceStepForNonActiveNonCompletedStep() { // Arrange Description description = new Description("Take the Key."); Duration expected = new Duration(1000); Duration limit = new Duration(2000); Interaction interaction = new Interaction(Act.Grab, description, expected, limit); LeafStep leafStep = new LeafStep(Standard.Mandatory, "Taking Key", interaction); // Act leafStep.AdvanceStep(DateTime.Now); // Assert Assert.AreEqual(true, leafStep.Active); Assert.AreEqual(false, leafStep.Completed); }