public void Init() { ISortedDictionary <string, string> dict = new TreeDictionary <string, string>(new SC()); dict.Add("A", "1"); dict.Add("C", "2"); dict.Add("E", "3"); this.dict = new GuardedSortedDictionary <string, string>(dict); }
public void Init() { ISortedDictionary <string, string> dict = new TreeDictionary <string, string>(new SC()) { { "A", "1" }, { "C", "2" }, { "E", "3" } }; this.dict = new GuardedSortedDictionary <string, string>(dict); }
public void Keys_returns_GuardedSorted() { var reverse = ComparerFactory <int> .CreateComparer((a, b) => a > b? -1 : 1); var source = new SortedArrayDictionary <int, string>(reverse) { [1] = "one", [2] = "two", [3] = "three" }; var guarded = new GuardedSortedDictionary <int, string>(source); Assert.IsAssignableFrom <GuardedSorted <int> >(guarded.Keys); }
public void Values_returns_Values() { var reverse = ComparerFactory <int> .CreateComparer((a, b) => a > b? -1 : 1); var source = new SortedArrayDictionary <int, string>(reverse) { [1] = "one", [2] = "two", [3] = "three" }; var guarded = new GuardedSortedDictionary <int, string>(source); CollectionAssert.AreEquivalent(new[] { "one", "two", "three" }, guarded.Values); }
public void Dispose() { dict = null; }