示例#1
0
 public void ICollectionCopyToThrowsArgumentIndexExceptionWithArrayIndexPastEnd()
 {
     var d = new HyperDictionary();
     d.Add("foo", "bar");
     d.Add("baz", "boo");
     d.CopyTo(new KeyValuePair<string, object>[2], 1);
 }
示例#2
0
 public void ICollectionCopyToThrowsArgumentIndexExceptionWithTooSmallDestinationArray()
 {
     var d = new HyperDictionary();
     d.Add("foo", "bar");
     d.Add("baz", "boo");
     d.CopyTo(new KeyValuePair<string, object>[1], 0);
 }
示例#3
0
        public void ICollectionCopyToWithZeroArrayIndexWorks()
        {
            var a = new KeyValuePair<string, object>[3];
            a[0] = new KeyValuePair<string, object>("first", null);
            a[1] = new KeyValuePair<string, object>("second", "i'm second");
            a[2] = new KeyValuePair<string, object>("third", "i'm third");
            var d = new HyperDictionary();
            d.Add("1st", "HyperDictionary first");
            d.Add("2nd", "HyperDictionary second");

            d.CopyTo(a, 0);
            Assert.AreEqual("1st", a[0].Key);
            Assert.AreEqual("HyperDictionary first", a[0].Value);
            Assert.AreEqual("2nd", a[1].Key);
            Assert.AreEqual("HyperDictionary second", a[1].Value);
            Assert.AreEqual("third", a[2].Key);
            Assert.AreEqual("i'm third", a[2].Value);
        }