public void StartSleepTest(double sleepSeconds) { //-- Arrange var sleeper = new Sleeper(); var expectedMilliseconds = sleepSeconds * 1000; var expectedRequest = 1; var expectedRun = 1; var expectedTotal = sleepSeconds; //-- Act sleeper.RunTimer.Start(); var actualTotal = sleeper.StartSleep(sleepSeconds).Result; sleeper.RunTimer.Stop(); var actualMilliseconds = sleeper.RunTimer.Elapsed.TotalMilliseconds; var actualRequest = sleeper.ThreadsRequested; var actualRun = sleeper.ThreadsRun; //-- Assert Assert.AreEqual(expectedMilliseconds, actualMilliseconds, 100); Assert.AreEqual(expectedTotal, actualTotal); Assert.AreEqual(expectedRun, actualRun); Assert.AreEqual(expectedRequest, actualRequest); }