public void CountWithSameValues() { _dictionary.Add("key", "value1"); _dictionary.Add("key", "value2"); _dictionary.Add("key2", "value3"); Assert.That(_dictionary.Count, Is.EqualTo(2)); Assert.That(_dictionary.KeyCount, Is.EqualTo(2)); Assert.That(_dictionary.CountValues(), Is.EqualTo(3)); }
/// <summary> ///CountValues 的测试 ///</summary> public void CountValuesTestHelper <KeyT, ValueT>() { bool allowDuplicateValues = false; // TODO: 初始化为适当的值 MultiDictionary <KeyT, ValueT> target = new MultiDictionary <KeyT, ValueT>(allowDuplicateValues); // TODO: 初始化为适当的值 KeyT key = default(KeyT); // TODO: 初始化为适当的值 int expected = 0; // TODO: 初始化为适当的值 int actual; actual = target.CountValues(key); Assert.AreEqual(expected, actual); Assert.Inconclusive("验证此测试方法的正确性。"); }