public void reverseKeyValue_ReverseCausesDuplicates() { StringDictionary sd = new StringDictionary(); sd.Add("1", "one"); sd.Add("2", "ONE"); VistaUtils.reverseKeyValue(sd); }
public void reverseKeyValue() { StringDictionary sd = new StringDictionary(); sd.Add("1", "one"); sd.Add("2", "two"); StringDictionary ds = VistaUtils.reverseKeyValue(sd); foreach (string key in ds.Keys) { Assert.IsNotNull(sd[ds[key]]); } Assert.AreEqual(1995535015, new TOEqualizer(ds).HashCode); }
public void reverseKeyValue() { StringDictionary sd = new StringDictionary(); sd.Add("1", "one"); sd.Add("2", "two"); StringDictionary ds = VistaUtils.reverseKeyValue(sd); foreach (string key in ds.Keys) { Assert.IsNotNull(sd[ds[key]]); } Assert.IsTrue(ds.ContainsKey("one")); Assert.IsTrue(ds.ContainsKey("two")); Assert.AreEqual(ds.Count, sd.Count); //Hash Code is not stable acrosss .Net Versions //Assert.AreEqual(1995535015, new TOEqualizer(ds).HashCode); }
public void reverseKeyValue_null() { VistaUtils.reverseKeyValue(null); }