public void testUnexpiredMessageAccepted()
 {
     DateTime future = DateTime.Now + new TimeSpan(0, 0, 1, 0);
     IMessage message = MessageBuilder.WithPayload("unexpired").SetExpirationDate(future).Build();
     UnexpiredMessageSelector selector = new UnexpiredMessageSelector();
     Assert.IsTrue(selector.Accept(message));
 }
 public void testExpiredMessageRejected()
 {
     DateTime past = DateTime.Now - new TimeSpan(0, 0, 1, 0);
     IMessage message = MessageBuilder.WithPayload("expired").SetExpirationDate(past).Build();
     UnexpiredMessageSelector selector = new UnexpiredMessageSelector();
     Assert.IsFalse(selector.Accept(message));
 }
 public void testMessageWithNullExpirationDateNeverExpires()
 {
     IMessage message = MessageBuilder.WithPayload("unexpired").Build();
     UnexpiredMessageSelector selector = new UnexpiredMessageSelector();
     Assert.IsTrue(selector.Accept(message));
 }