示例#1
0
        public void TestToString()
        {
            ReentrantLock locker = new ReentrantLock();
            String        us     = locker.ToString();

            Assert.IsTrue(us.IndexOf("Unlocked") >= 0);
            locker.Lock();
            String ls = locker.ToString();

            Assert.IsTrue(ls.IndexOf("Locked") >= 0);
        }
示例#2
0
 public void TestToString()
 {
     ReentrantLock locker = new ReentrantLock();
     String us = locker.ToString();
     Assert.IsTrue(us.IndexOf("Unlocked") >= 0);
     locker.Lock();
     String ls = locker.ToString();
     Assert.IsTrue(ls.IndexOf("Locked") >= 0);
 }