public void TestClearEmptyChannel()
 {
     QueueChannel channel = new QueueChannel();
     IList<IMessage> clearedMessages = channel.Clear();
     Assert.IsNotNull(clearedMessages);
     Assert.That(clearedMessages.Count, Is.EqualTo(0));
 }
 public void TestClear()
 {
     QueueChannel channel = new QueueChannel(2);
     StringMessage message1 = new StringMessage("test1");
     StringMessage message2 = new StringMessage("test2");
     StringMessage message3 = new StringMessage("test3");
     Assert.IsTrue(channel.Send(message1));
     Assert.IsTrue(channel.Send(message2));
     Assert.IsFalse(channel.Send(message3, TimeSpan.Zero));
     IList<IMessage> clearedMessages = channel.Clear();
     Assert.IsNotNull(clearedMessages);
     Assert.That(clearedMessages.Count, Is.EqualTo(2));
     Assert.IsTrue(channel.Send(message3));
 }