public void TestEmptyFull()
        {
            LinkedBlockingQueue <String> q = new LinkedBlockingQueue <String>(2);

            Assert.IsTrue(q.IsEmpty());
            Assert.AreEqual(2, q.RemainingCapacity(), "should have room for 2");
            q.Add(one);
            Assert.IsFalse(q.IsEmpty());
            q.Add(two);
            Assert.IsFalse(q.IsEmpty());
            Assert.AreEqual(0, q.RemainingCapacity());
            Assert.IsFalse(q.Offer(three));
        }
 public void TestAdd()
 {
     try
     {
         LinkedBlockingQueue <String> q = new LinkedBlockingQueue <String>(SIZE);
         for (int i = 0; i < SIZE; ++i)
         {
             Assert.IsTrue(q.Add(i.ToString()));
         }
         Assert.AreEqual(0, q.RemainingCapacity());
         q.Add(SIZE.ToString());
     }
     catch (IllegalStateException)
     {
     }
 }
 public void TestAddNull()
 {
     try
     {
         LinkedBlockingQueue <String> q = new LinkedBlockingQueue <String>();
         q.Add(null);
         ShouldThrow();
     }
     catch (NullReferenceException) {}
 }
        public void TestRemainingCapacity()
        {
            LinkedBlockingQueue <String> q = PopulatedDeque(SIZE);

            for (int i = 0; i < SIZE; ++i)
            {
                Assert.AreEqual(i, q.RemainingCapacity());
                Assert.AreEqual(SIZE - i, q.Size());
                q.Remove();
            }
            for (int i = 0; i < SIZE; ++i)
            {
                Assert.AreEqual(SIZE - i, q.RemainingCapacity());
                Assert.AreEqual(i, q.Size());
                q.Add(i.ToString());
            }
        }