public void Remove_ReturnsTrue_WhenKeyFound() { var res = _dictionary.Remove("key"); res.Should().BeTrue(); _dictionary.AsEnumerable().Should().BeEmpty(); }
public void Construct_WithEmptyDictionaryParameter_IsEmpty() { var dict = new Dictionary <string, string>(); var target = new SingleDictionary <string, string>(dict); target.AsEnumerable().Should().BeEmpty(); }
public void Add_AddKeyValue_WhenDictionaryIsEmpty() { _dictionary = new SingleDictionary <string, string>(); _dictionary.Add(new KeyValuePair <string, string> ("key2", "value2")); _dictionary.AsEnumerable().Should().BeEquivalentTo(new KeyValuePair <string, string>[] { new KeyValuePair <string, string>("key2", "value2") }); }
public void Remove_ReturnsFalse_WhenKeyNotFound_WhenEmpty() { _dictionary = new SingleDictionary <string, string>(); var res = _dictionary.Remove("Key"); res.Should().BeFalse(); _dictionary.AsEnumerable().Should().BeEmpty(); }