public void ReturnsTrue_When_KeyExistsInStore()
        {
            // Arrange
            const string key   = "TestKey";
            var          item1 = new TestObject(1, "Jane Smith");

            _sut.SetItem(key, item1);

            // Act
            var containsKey = _sut.ContainKey(key);

            // Assert
            Assert.True(containsKey);
        }
Beispiel #2
0
        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));
        }