示例#1
0
        public void When_adding_a_new_message_that_already_exist_it_should_not_override_it()
        {
            var store   = new ConcurrentInMemoryMessageStore();
            var message = new Message();

            store.Add(message);
            store.Add(message);
            var storedMessage = store.Get(message.Id);

            Assert.That(storedMessage, Is.EqualTo(message));
        }
示例#2
0
        public void When_getting_a_message_it_should_then_remove_it()
        {
            var store   = new ConcurrentInMemoryMessageStore();
            var message = new Message();

            store.Add(message);
            var storedMessage = store.Get(message.Id);

            Assert.That(storedMessage, Is.Not.Null);
            storedMessage = store.Get(message.Id);
            Assert.That(storedMessage, Is.Null);
        }