Skip to content

Commit

Permalink
[tests] Fix some corlib unit tests to run successfully on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
spouliot committed Dec 12, 2013
1 parent 1786712 commit e33b302
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Expand Up @@ -180,7 +180,9 @@ public void FinishedTaskOnCompleted ()
});

mres.Set ();
Assert.IsTrue (mres2.WaitOne (2000), "#2");;
// this will only terminate correctly if the test was not executed from the main thread
// e.g. Touch.Unit defaults to run tests on the main thread and this will return false
Assert.AreEqual (Thread.CurrentThread.IsBackground, mres2.WaitOne (2000), "#2");;
}
}
}
Expand Down
Expand Up @@ -152,6 +152,7 @@ public void CaptureCallContext ()
}

[Test]
[Category("MobileNotWorking")]
public void Capture ()
{
ExecutionContext ec = ExecutionContext.Capture ();
Expand All @@ -169,6 +170,7 @@ public void Capture ()
}

[Test]
[Category("MobileNotWorking")]
public void Copy ()
{
ExecutionContext ec = ExecutionContext.Capture ();
Expand Down Expand Up @@ -198,6 +200,7 @@ public void Copy_FromThread ()
}

[Test]
[Category("MobileNotWorking")]
public void IsFlowSuppressed ()
{
Assert.IsFalse (ExecutionContext.IsFlowSuppressed (), "IsFlowSuppressed-1");
Expand All @@ -211,12 +214,14 @@ public void IsFlowSuppressed ()

[Test]
[ExpectedException (typeof (InvalidOperationException))]
[Category("MobileNotWorking")]
public void RestoreFlow_None ()
{
ExecutionContext.RestoreFlow ();
}

[Test]
[Category("MobileNotWorking")]
public void RestoreFlow_SuppressFlow ()
{
Assert.IsFalse (ExecutionContext.IsFlowSuppressed (), "IsFlowSuppressed-1");
Expand All @@ -237,6 +242,7 @@ public void RestoreFlow_SuppressFlow ()

[Test]
[ExpectedException (typeof (InvalidOperationException))]
[Category("MobileNotWorking")]
public void Run_SuppressFlow ()
{
Assert.IsFalse (ExecutionContext.IsFlowSuppressed ());
Expand All @@ -251,6 +257,7 @@ public void Run_SuppressFlow ()
}

[Test]
[Category("MobileNotWorking")]
public void SuppressFlow ()
{
Assert.IsFalse (ExecutionContext.IsFlowSuppressed (), "IsFlowSuppressed-1");
Expand All @@ -264,6 +271,7 @@ public void SuppressFlow ()

[Test]
[ExpectedException (typeof (InvalidOperationException))]
[Category("MobileNotWorking")]
public void SuppressFlow_Two_Undo ()
{
Assert.IsFalse (ExecutionContext.IsFlowSuppressed (), "IsFlowSuppressed-1");
Expand Down

0 comments on commit e33b302

Please sign in to comment.