示例#1
0
        public void AddRangeNull()
        {
            var collection = new DataTableMappingCollection();

            Assert.Throws <ArgumentNullException>(() => collection.AddRange(default(Array)));
            Assert.Throws <ArgumentNullException>(() => collection.AddRange(default(DataTableMapping[])));
        }
示例#2
0
        public void AddRangeArray()
        {
            Array array      = new DataTableMapping[] { new DataTableMapping("source", "dataSet") };
            var   collection = new DataTableMappingCollection();

            collection.AddRange(array);
            Assert.Single(collection);
            Assert.Same(array.GetValue(0), collection[0]);
        }
示例#3
0
        public void AddRange()
        {
            _tableMapCollection.Add(new DataTableMapping("sourceFactory", "dataSetFactory"));
            Assert.Equal(1, _tableMapCollection.Count);
            _tableMapCollection.AddRange(_tabs);
            Assert.Equal(6, _tableMapCollection.Count);
            bool eq;

            eq = _tabs[0].Equals(_tableMapCollection[1]);
            Assert.True(eq);
            eq = _tabs[1].Equals(_tableMapCollection[2]);
            Assert.True(eq);
            eq = _tabs[0].Equals(_tableMapCollection[0]);
            Assert.False(eq);
            eq = _tabs[1].Equals(_tableMapCollection[0]);
            Assert.False(eq);
        }
        public void AddRange()
        {
            tableMapCollection.Add(new DataTableMapping("sourceFactory", "dataSetFactory"));
            Assert.AreEqual(1, tableMapCollection.Count, "test1");
            tableMapCollection.AddRange(tabs);
            Assert.AreEqual(6, tableMapCollection.Count, "test2");
            bool eq;

            eq = tabs[0].Equals(tableMapCollection[1]);
            Assert.AreEqual(true, eq, "test3");
            eq = tabs[1].Equals(tableMapCollection[2]);
            Assert.AreEqual(true, eq, "test4");
            eq = tabs[0].Equals(tableMapCollection[0]);
            Assert.AreEqual(false, eq, "test5");
            eq = tabs[1].Equals(tableMapCollection[0]);
            Assert.AreEqual(false, eq, "test6");
        }