Ejemplo n.º 1
0
        public void reverseKeyValue_ReverseCausesDuplicates()
        {
            StringDictionary sd = new StringDictionary();

            sd.Add("1", "one");
            sd.Add("2", "ONE");

            VistaUtils.reverseKeyValue(sd);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 public void reverseKeyValue_null()
 {
     VistaUtils.reverseKeyValue(null);
 }