mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-17 05:35:07 +00:00
Updating SafeTimer test to ensure SafeTimer.Stopped() doesn't execute the callback
This commit is contained in:
@@ -33,11 +33,14 @@ namespace ICD.Common.Utils.Tests.Timers
|
|||||||
{
|
{
|
||||||
bool called = false;
|
bool called = false;
|
||||||
SafeTimer timer = SafeTimer.Stopped(() => called = true);
|
SafeTimer timer = SafeTimer.Stopped(() => called = true);
|
||||||
|
|
||||||
|
ThreadingUtils.Sleep(200);
|
||||||
|
Assert.IsFalse(called);
|
||||||
|
|
||||||
timer.Reset(100);
|
timer.Reset(100);
|
||||||
timer.Stop();
|
timer.Stop();
|
||||||
|
|
||||||
ThreadingUtils.Sleep(200);
|
ThreadingUtils.Sleep(200);
|
||||||
|
|
||||||
Assert.IsFalse(called);
|
Assert.IsFalse(called);
|
||||||
|
|
||||||
timer.Dispose();
|
timer.Dispose();
|
||||||
|
|||||||
Reference in New Issue
Block a user