public void AddRange()
        {
            NamedObjectCollection<NamedTestObject> collection = new NamedObjectCollection<NamedTestObject>();
              collection.AddRange(new[]
              {
            new NamedTestObject("foo1", 1),
            new NamedTestObject("foo2", 2)
              });

              Assert.AreEqual(1, collection["foo1"].Value);
              Assert.AreEqual(2, collection["foo2"].Value);
              Assert.AreEqual(1, collection[0].Value);
              Assert.AreEqual(2, collection[1].Value);
        }
Beispiel #2
0
        public void AddRange()
        {
            NamedObjectCollection <NamedTestObject> collection = new NamedObjectCollection <NamedTestObject>();

            collection.AddRange(new[]
            {
                new NamedTestObject("foo1", 1),
                new NamedTestObject("foo2", 2)
            });

            Assert.AreEqual(1, collection["foo1"].Value);
            Assert.AreEqual(2, collection["foo2"].Value);
            Assert.AreEqual(1, collection[0].Value);
            Assert.AreEqual(2, collection[1].Value);
        }
Beispiel #3
0
        public void AddRangeShouldThrowWhenNull()
        {
            NamedObjectCollection <NamedTestObject> collection = new NamedObjectCollection <NamedTestObject>();

            collection.AddRange(null);
        }
 public void AddRangeShouldThrowWhenNull()
 {
     NamedObjectCollection<NamedTestObject> collection = new NamedObjectCollection<NamedTestObject>();
       collection.AddRange(null);
 }