public void CanRemoveCompleteFirstLevel() { var key1 = 5; var key21 = "key1"; var key22 = "key2"; var key12 = 2; var dictionary = new DoubleKeyDictionary <int, string, string>(); dictionary.Add(key1, key21, "value11"); dictionary.Add(key1, key22, "value2"); dictionary.Add(key12, key21, "value3"); dictionary.Add(key12, key22, "value4"); var result = dictionary.Remove(key1); result.Should().BeTrue(); dictionary.Count.Should().Be(2); dictionary.Contains(key1, key21).Should().BeFalse(); dictionary.Contains(key1, key22).Should().BeFalse(); dictionary.GetAll().FirstOrDefault(x => x == "value11").Should().BeNullOrEmpty(); dictionary.GetAll().FirstOrDefault(x => x == "value2").Should().BeNullOrEmpty(); }