Timer t = new Timer (new TimerCallback (Callback), bucket, 10, 10);
Thread.Sleep (500);
int c = bucket.count;
- Assert.IsTrue(c > 20, "#1");
+ Assert.IsTrue (c > 20, "#1 " + c.ToString ());
t.Change (100, 100);
c = bucket.count;
Thread.Sleep (500);
- Assert.IsTrue(bucket.count <= c + 20, "#2");
+ Assert.IsTrue (bucket.count <= c + 20, "#2 " + c.ToString ());
t.Dispose ();
}
Thread.Sleep(100);
t.Change (int.MaxValue, Timeout.Infinite);
// since period is 0 the callback should happen once (bug #340212)
- Assert.IsTrue(b.count == 1);
-
+ Assert.AreEqual (1, b.count, "only once");
}
-#if !MONOTOUCH
[Test]
+ [Ignore ()]
public void TestDisposeOnCallback ()
{
// this test is bad, as the provided `state` (t1) is null and will throw an NRE inside the callback
{
((Timer) foo).Dispose ();
}
-#endif
private void Callback (object foo)
{