예제 #1
0
        public void InmemoryStorage_AddToList_Multiple()
        {
            var storage = new InmemoryStorage();

            storage.AddToList(new StorageKey("storage", "key"), "one");
            storage.AddToList(new StorageKey("storage", "key"), "two");
        }
예제 #2
0
        public void InmemoryStorage_Get()
        {
            var storage = new InmemoryStorage();

            storage.Set(new StorageKey("storage", "key"), "value");

            Assert.AreEqual("value", storage.Get <string>(new StorageKey("storage", "key")));
        }
예제 #3
0
        public void InmemoryStorage_GetList_Invalid()
        {
            var storage = new InmemoryStorage();

            storage.Set(new StorageKey("storage", "key"), new StorageModel {
                Id = 1, Value = "one"
            });

            Assert.IsEmpty(storage.GetList <StorageModel>(new StorageKey("storage", "key")));
        }
예제 #4
0
        public void InmemoryStorage_Item_Object()
        {
            var storage = new InmemoryStorage();

            storage.Set(new StorageKey("storage", "key"), new StorageModel {
                Id = 1, Value = "one"
            });

            var item = storage.Get <StorageModel>(new StorageKey("storage", "key"));

            item.MatchSnapshot();
        }
예제 #5
0
        public void InmemoryStorage_List_Objects()
        {
            var storage = new InmemoryStorage();

            storage.AddToList(new StorageKey("storage", "key"), new StorageModel {
                Id = 1, Value = "one"
            });
            storage.AddToList(new StorageKey("storage", "key"), new StorageModel {
                Id = 2, Value = "two"
            });

            var items = storage.GetList <StorageModel>(new StorageKey("storage", "key"));

            items.MatchSnapshot();
        }
예제 #6
0
        public void InmemoryStorage_RemoveRange()
        {
            var storage = new InmemoryStorage();

            storage.AddToList(new StorageKey("storage", "key"), new StorageModel {
                Id = 1, Value = "one"
            });
            storage.AddToList(new StorageKey("storage", "key"), new StorageModel {
                Id = 1, Value = "one"
            });

            Assert.AreEqual(2, storage.GetList <StorageModel>(new StorageKey("storage", "key")).Count());

            storage.RemoveRangeFromList(new StorageKey("storage", "key"), 3);

            Assert.IsEmpty(storage.GetList <StorageModel>(new StorageKey("storage", "key")));
        }
예제 #7
0
        public void InmemoryStorage_AddToList()
        {
            var storage = new InmemoryStorage();

            storage.AddToList(new StorageKey("storage", "key"), "value");
        }
예제 #8
0
 public void InmemoryStorage_Ctor()
 {
     var storage = new InmemoryStorage();
 }