public void SaveMessageTest() { var pers = new InMemoryPersistanceService(); var message = GetTempMessage(); pers.Save(message); var list = pers.Get(message.Topic, message.CreationUTC.AddSeconds(-1)); Assert.Contains(message, list); }
public void RemoveMessageTest() { var pers = new InMemoryPersistanceService(); var message = GetTempMessage(); pers.Save(message); pers.Remove(message.Topic, message.CreationUTC.AddMinutes(-1)); var list = pers.Get(message.Topic, message.CreationUTC.AddMinutes(-1)); Assert.Contains(message, list); pers.Remove(message.Topic, message.CreationUTC.AddMinutes(1)); list = pers.Get(message.Topic, message.CreationUTC); Assert.DoesNotContain(message, list); }