public void RestartExistingThatRuns() { var msw = new MultiStopwatch(); msw.Start("test"); Thread.Sleep(100); var elapsedBeforeRestart = msw.Elapsed("test"); msw.Restart("test"); var elapsedAfterRestart = msw.Elapsed("test"); //this fails if Restart and Elapsed takes longer then 100ms, which can habben while debugging. Assert.Less(elapsedAfterRestart, elapsedBeforeRestart); }
public void ElapsedWithExistingStopwatch() { var msw = new MultiStopwatch(); msw.Start("test"); var elapsedTimeSpan = msw.Elapsed("test"); Assert.IsTrue(elapsedTimeSpan.Ticks>=0); }
public void ElapsedWithNotExistingStopwatch() { var msw = new MultiStopwatch(); msw.Elapsed("test"); }