public void Test1() { String jsonString = "{ \"value\" : 10 }"; Test1Class t = global::HySON.HySON.parse <Test1Class>(jsonString, typeof(Test1Class)); Assert.AreEqual(10, t.value); }
static void TryAnotherWay () { Test1Class test1 = new Test1Class (); Test1Class test2 = new Test1Class (); if (!test1.Run ()) _success = false; if (!test2.Run ()) _success = false; }
static void TestThread (object obj) { int testCount = ((int) obj); if (testCount > 0) { TryAnotherWay (); // This one is always okay Test1Class test1 = new Test1Class (); Test1Class test2 = new Test1Class (); // Coment me and 23 out and it works if (!test1.Run ()) _success = false; if (!test2.Run ()) // Coment me and 21 out and it works _success = false; TryAnotherWay (); // This one is now bad } else { // Or Remove this entire else block and it works ParameterizedThreadStart ts = new ParameterizedThreadStart (TestThread); Thread t = new Thread (ts); t.Start (2); t.Join (); } }