Пример #1
0
        public void RemoveTest()
        {
            var memoryStorage = new InMemoryStorage();
            var item          = new ReminderItem();
            var id            = Guid.NewGuid();

            memoryStorage.Add(id, item);

            Assert.AreEqual(memoryStorage.Count(), 1);

            memoryStorage.Remove(id);

            Assert.AreEqual(memoryStorage.Count(), 0);
        }
Пример #2
0
        public void InitializeTest()
        {
            var memoryStorage = new InMemoryStorage();

            memoryStorage.Clear();
            Assert.AreEqual(memoryStorage.Count(), 0);
        }
Пример #3
0
        public void ClearTest()
        {
            var memoryStorage = new InMemoryStorage();
            var item          = new ReminderItem();
            var id            = Guid.NewGuid();

            memoryStorage.Add(id, item);
            var id2   = Guid.NewGuid();
            var item2 = new ReminderItem();

            memoryStorage.Add(id2, item2);

            Assert.AreEqual(memoryStorage.Count(), 2);

            memoryStorage.Clear();

            Assert.AreEqual(memoryStorage.Count(), 0);
        }