The Count property of the multi dictionary now returns either the value count of the number of unique keys depending on which interface it is called from

git-svn-id: file:///srv/devel/repo-conversion/nusu@259 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
Markus Ewald 2012-03-01 14:48:53 +00:00
parent ca373846aa
commit 0195b34289
2 changed files with 22 additions and 0 deletions

View file

@ -139,6 +139,21 @@ namespace Nuclex.Support.Collections {
);
}
/// <summary>
/// Verifies that the Count property returns the number of unique keys if it is called
/// on the collection-of-collections interface implemented by the multi dictionary
/// </summary>
[Test]
public void CollectionOfCollectionCountIsUniqueKeyCount() {
var dictionary = new MultiDictionary<int, string>();
dictionary.Add(10, "ten");
dictionary.Add(10, "zehn");
Assert.AreEqual(2, dictionary.Count);
var collectionOfCollections = (ICollection<KeyValuePair<int, ICollection<string>>>)dictionary;
Assert.AreEqual(1, collectionOfCollections.Count);
}
}
} // namespace Nuclex.Support.Collections