public void ContainsKey() { var intervalDictionary = new IntervalDictionary <int, string> { { new Interval <int>(5, 10), "5 - 10" }, { new Interval <int>(15, 20), "15 - 20" }, { new Interval <int>(25, 25), "25 - 25" } }; Assert.IsTrue(intervalDictionary.ContainsKey(5)); Assert.IsTrue(intervalDictionary.ContainsKey(7)); Assert.IsTrue(intervalDictionary.ContainsKey(25)); Assert.IsFalse(intervalDictionary.ContainsKey(30)); }
public void ContainsKeyArgumentNullException() { var intervalDictionary = new IntervalDictionary <string, string> { { new Interval <string>("a", "c"), "a - c" }, { new Interval <string>("h", "j"), "h - j" }, { new Interval <string>("x", "z"), "x - z" } }; intervalDictionary.ContainsKey(null); }
public void ContainsKeyArgumentNullException() { var intervalDictionary = new IntervalDictionary<string, string> { { new Interval<string>("a", "c"), "a - c" }, { new Interval<string>("h", "j"), "h - j" }, { new Interval<string>("x", "z"), "x - z" } }; intervalDictionary.ContainsKey(null); }
public void ContainsKey() { var intervalDictionary = new IntervalDictionary<int, string> { { new Interval<int>(5, 10), "5 - 10" }, { new Interval<int>(15, 20), "15 - 20" }, { new Interval<int>(25, 25), "25 - 25" } }; Assert.IsTrue(intervalDictionary.ContainsKey(5)); Assert.IsTrue(intervalDictionary.ContainsKey(7)); Assert.IsTrue(intervalDictionary.ContainsKey(25)); Assert.IsFalse(intervalDictionary.ContainsKey(30)); }