mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 21:24:58 +00:00
Slighly better SafeInvoke tests
This commit is contained in:
@@ -20,7 +20,7 @@ namespace ICD.Common.Utils.Tests
|
|||||||
public void SafeInvokeTest()
|
public void SafeInvokeTest()
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
ThreadingUtils.SafeInvoke(() => result = true);
|
ThreadingUtils.SafeInvoke(() => { ThreadingUtils.Sleep(100); result = true; });
|
||||||
|
|
||||||
Assert.IsFalse(result);
|
Assert.IsFalse(result);
|
||||||
ThreadingUtils.Sleep(1000);
|
ThreadingUtils.Sleep(1000);
|
||||||
@@ -31,7 +31,7 @@ namespace ICD.Common.Utils.Tests
|
|||||||
public void SafeInvokeParamTest()
|
public void SafeInvokeParamTest()
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
ThreadingUtils.SafeInvoke(p => result = p, true);
|
ThreadingUtils.SafeInvoke(p => { ThreadingUtils.Sleep(100); result = p; }, true);
|
||||||
|
|
||||||
Assert.IsFalse(result);
|
Assert.IsFalse(result);
|
||||||
ThreadingUtils.Sleep(1000);
|
ThreadingUtils.Sleep(1000);
|
||||||
|
|||||||
Reference in New Issue
Block a user