System.Data.Tests.DataTableCollectionTest.Remove C# (CSharp) Method

Remove() private method

private Remove ( ) : void
return void
        public void Remove()
        {
            DataTableCollection tbcol = _dataset[0].Tables;
            tbcol.Clear();
            /* _tables is array of DataTables defined in Setup */
            tbcol.AddRange(_tables);

            /* removing a recently added table */
            int count = tbcol.Count;
            tbcol.Remove(_tables[0]);
            Assert.Equal(count - 1, tbcol.Count);
            DataTable tbl = null;
            /* removing a null reference. must generate an Exception */
            try
            {
                tbcol.Remove(tbl);
                Assert.False(true);
            }
            catch (Exception e)
            {
                Assert.Equal(typeof(ArgumentNullException), e.GetType());
            }
            /* removing a table that is not there in collection */
            try
            {
                tbcol.Remove(new DataTable("newTable"));
                Assert.False(true);
            }
            catch (Exception e)
            {
                Assert.Equal(typeof(ArgumentException), e.GetType());
            }
        }
        [Fact]