public void GetTotalSeconds() { var instrumentation = new Instrumentation(); instrumentation.Start(); Thread.Sleep(750); Assert.AreEqual(1, instrumentation.GetElapsedTime()); }
public void GetTotalSeconds() { var instrumentation = new Instrumentation(); instrumentation.Start(); Thread.Sleep(750); Assert.AreEqual(1, instrumentation.GetElapsedTime()); //passes bacause GetElapsedTime() rounds to whole seconds }
public void GetPreciseElapsedTime() { var instrumentation = new Instrumentation(); instrumentation.Start(); Thread.Sleep(750); var elapsed = instrumentation.GetElapsedTime(); Assert.IsTrue(elapsed >= 0.75 && elapsed <= 1); }
public void StartTest() { //-- Arrange Instrumentation instrumentation = new Instrumentation(); //-- Act instrumentation.Start(); Thread.Sleep(750); int actual = instrumentation.GetElapsedTime(); Debug.Write(actual); //-- Assert Assert.AreEqual(1, actual); }