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_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_Get_Invalid() { var storage = new InmemoryStorage(); storage.AddToList(new StorageKey("storage", "key"), new StorageModel { Id = 1, Value = "one" }); Assert.IsNull(storage.Get <StorageModel>(new StorageKey("storage", "key"))); }
public void InmemoryStorage_AddToList() { var storage = new InmemoryStorage(); storage.AddToList(new StorageKey("storage", "key"), "value"); }