System.Data.Tests.DataRowTest2.GetChildRows_DataRelation C# (CSharp) Method

GetChildRows_DataRelation() private method

private GetChildRows_DataRelation ( ) : void
return void
        public void GetChildRows_DataRelation()
        {
            DataRow dr;
            DataRow[] drArrExcepted, drArrResult;
            DataTable dtChild, dtParent;
            var ds = new DataSet();

            //Create tables
            dtChild = DataProvider.CreateChildDataTable();
            dtParent = DataProvider.CreateParentDataTable();

            //Add tables to dataset
            ds.Tables.Add(dtChild);
            ds.Tables.Add(dtParent);
            dr = dtParent.Rows[0];

            //Add Relation
            DataRelation dRel = new DataRelation("Parent-Child", dtParent.Columns["ParentId"], dtChild.Columns["ParentId"]);
            ds.Relations.Add(dRel);
            //Get Excepted result
            drArrExcepted = dtChild.Select("ParentId=" + dr["ParentId"]);
            //Get Result
            drArrResult = dr.GetChildRows(dRel);

            Assert.Equal(drArrExcepted, drArrResult);
        }
DataRowTest2