public async Task SetRange_ShouldAddDataToHashDictionary() { var data = HashTestData.GenerateKeyValuePairs(); await this.hashDictionary.SetRange(data); Assert.True((await this.hashDictionary.ContainsKey("2"))); Assert.True((await this.hashDictionary.Count()) == 10); }
public async Task GetRange_ShouldReturnSameCollection() { var data = HashTestData.GenerateKeyValuePairs(); await this.hashDictionary.SetRange(data); var actual = await this.hashDictionary.GetRange(new[] { "2", "4" }); Assert.Equal(new[] { 2, 4 }, (ICollection)actual); }
public async Task RemoveRange_ShouldDeleteCollectionFromDictionary() { var data = HashTestData.GenerateKeyValuePairs(); await this.hashDictionary.SetRange(data); var originalCount = await this.hashDictionary.Count(); var deleted = await this.hashDictionary.RemoveRange(new[] { "2", "4" }); var actual = await this.hashDictionary.Count(); var expected = originalCount - deleted; Assert.Equal(expected, actual); }
public async Task KeysAndValues_ShouldReturnSameCount() { var data = HashTestData.GenerateKeyValuePairs(); await this.hashDictionary.SetRange(data); var keys = await this.hashDictionary.Keys(); var values = await this.hashDictionary.Values(); var expectedCount = 10; Assert.Equal(expectedCount, keys.Count); Assert.Equal(expectedCount, values.Count); Assert.True(keys.Count == values.Count); }