System.Data.Tests.DataRowTest2.GetChildRows_ByDataRealtion C# (CSharp) Méthode

GetChildRows_ByDataRealtion() private méthode

private GetChildRows_ByDataRealtion ( ) : void
Résultat void
        public void GetChildRows_ByDataRealtion()
        {
            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);

            // GetChildRows_D
            Assert.Equal(drArrExcepted, drArrResult);
        }
DataRowTest2