public void RemoveKeysAsync() { // Arrange const string key1 = "TestKey1"; const string key2 = "TestKey2"; const string key3 = "TestKey3"; _sut.Clear(); var item1 = new TestObject(1, "Jane Smith"); var item2 = new TestObject(2, "John Smith"); var item3 = new TestObject(3, "Jade Smith"); _sut.SetItem(key1, item1); _sut.SetItem(key2, item2); _sut.SetItem(key3, item3); // Act var keyNames = new string[] { key1, key2 }; _sut.RemoveItemsAsync(keyNames).AsTask().Wait(); // Assert Assert.Equal(1, _sut.Length()); Assert.NotNull(_sut.GetItem <TestObject>(key3)); }
public void ReturnsZeroWhenStoreIsEmpty() { // Act var itemCount = _sut.Length(); // Assert Assert.Equal(0, itemCount); }
public async Task <IEnumerable <string> > GetKeys() { var length = LocalStorageService.Length(); var keys = new List <string>(); for (int i = 0; i < length; i++) { keys.Add(LocalStorageService.Key(i)); } return(await Task.FromResult(keys)); }