public void Test_ShouldThrowInvalidOperationExceptionWhenStartingAgain() { var stoper = new MyStoper(); stoper.Start(); Assert.Throws <InvalidOperationException>(() => stoper.Start()); }
public void Test_ShouldReturnNotNullTime() { var stoper = new MyStoper(); stoper.Start(); stoper.Stop(); stoper.Start(); stoper.Stop(); double?time = stoper.Time; Assert.True(time is not null); }
public void Test_ShouldThrowArgumentExceptionWhenRunning() { var stoper = new MyStoper(); stoper.Start(); Assert.Throws <ArgumentException>(() => stoper.Time); }
public void Test_ShouldThrowInvalidOperationExceptionAfterRestarting() { var stoper = new MyStoper(); stoper.Start(); stoper.Stop(); stoper.Restart(); Assert.Throws <ArgumentException>(() => stoper.Time); }