public void double_start_no_exception() { // Arrange // Act var taskInfo = new TaskInfo(); taskInfo.Start(); taskInfo.Start(); // Assert // If we get here w/o an exception, we passed }
public void double_start_restarts_duration() { // Arrange // Act var taskInfo = new TaskInfo(); taskInfo.Start(); Thread.Sleep(31); taskInfo.Start(); Thread.Sleep(31); taskInfo.Stop(); // Assert Assert.LessOrEqual(.030, taskInfo.Duration); Assert.GreaterOrEqual(.060, taskInfo.Duration); }
public void Start(string taskName) { // lets do the waiting threads their work Thread.Sleep(0); var taskInfo = new TaskInfo(taskName); TimeDetails.Add(taskInfo); taskInfo.Start(); }
public void start_stop_check_time_success() { // Arrange // Act var taskInfo = new TaskInfo(); taskInfo.Start(); Thread.Sleep(31); taskInfo.Stop(); // Assert Assert.LessOrEqual(.030, taskInfo.Duration); }