public void MessageStoreTestMethod() { IMessageStore ms = new MemoryMessageStore(); Assert.IsTrue(ms != null); ms.SaveMessage(new Message1() { Data = "Hello world" }, DateTime.UtcNow.AddMinutes(30).Ticks); ms.SaveMessage(new Message2() { Data = "Hello world" }, DateTime.UtcNow.AddMinutes(30).Ticks); var msgs = ms.GetMessages(DateTime.UtcNow.Ticks); Assert.IsTrue(msgs.Count() == 2); }
public void MessageStoreTimeTestMethod() { IMessageStore ms = new MemoryMessageStore(); Assert.IsTrue(ms != null); ms.SaveMessage(new Message1() { Data = "Hello world" }, DateTime.UtcNow.AddSeconds(10).Ticks); ms.SaveMessage(new Message2() { Data = "Hello world" }, DateTime.UtcNow.AddSeconds(5).Ticks); ms.SaveMessage(new Message1() { Data = "Hello world" }, DateTime.UtcNow.AddSeconds(6).Ticks); System.Threading.Thread.Sleep(TimeSpan.FromSeconds(8)); var msgs = ms.GetMessages(DateTime.UtcNow.Ticks); Assert.IsTrue(msgs.Count() == 1); }