Test the Enter(object, ref bool) overload.
authorPaolo Molaro <lupus@oddwiz.org>
Wed, 28 Jul 2010 15:47:14 +0000 (17:47 +0200)
committerPaolo Molaro <lupus@oddwiz.org>
Wed, 28 Jul 2010 15:47:14 +0000 (17:47 +0200)
mcs/class/corlib/Test/System.Threading/MonitorTest.cs

index 34cbfdfaa857959ae1955ec69cc9a95b8b4f43d6..100d7eee404281e1c2a7f71d7c4419a04519679d 100644 (file)
@@ -303,6 +303,27 @@ namespace MonoTests.System.Threading {
                                Assert.IsFalse (Monitor.Wait (o, SmallNegative), "Wait");
                        }
                }
+#if NET_4_0
+               [Test]
+               public void Enter_bool ()
+               {
+                       object o = new object ();
+                       bool taken = false;
+                       Monitor.Enter (o, ref taken);
+                       Assert.IsTrue (taken, "Monitor.Enter (obj, ref taken)");
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentException))]
+               public void Enter_bool_argcheck ()
+               {
+                       object o = new object ();
+                       bool taken = true;
+                       Monitor.Enter (o, ref taken);
+               }
+
+#endif
+
        }
 }