public void InmemoryStorage_AddToList_Multiple() { var storage = new InmemoryStorage(); storage.AddToList(new StorageKey("storage", "key"), "one"); storage.AddToList(new StorageKey("storage", "key"), "two"); }
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"))); }
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"))); }
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(); }
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(); }
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"))); }
public void InmemoryStorage_AddToList() { var storage = new InmemoryStorage(); storage.AddToList(new StorageKey("storage", "key"), "value"); }
public void InmemoryStorage_Ctor() { var storage = new InmemoryStorage(); }