public void TestPutNull() { try { LinkedBlockingQueue <String> q = new LinkedBlockingQueue <String>(SIZE); q.Put(null); ShouldThrow(); } catch (NullReferenceException) { } catch (Exception) { UnexpectedException(); } }
public void TestPut() { try { LinkedBlockingQueue <String> q = new LinkedBlockingQueue <String>(SIZE); for (int i = 0; i < SIZE; ++i) { q.Put(i.ToString()); Assert.IsTrue(q.Contains(i.ToString())); } Assert.AreEqual(0, q.RemainingCapacity()); } catch (Exception) { UnexpectedException(); } }