public void ThrowsArgumentNullException_When_KeyIsInvalid(string key) { // arrange / act var action = new Action(() => _sut.GetItemAsString(key)); // assert Assert.Throws <ArgumentNullException>(action); }
public async ValueTask <string> GetItem(string key) { Logger.LogDebug("Getting item {key}", key); var content = String.Empty; if (LocalStorageService.ContainKey(key)) { Logger.LogDebug("Item {key} exists in the local storage; loading", key); content = LocalStorageService.GetItemAsString(key); } return(await Task.FromResult(content)); }