Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }