public void GetParentRow_ByName()
{
DataRow drExcepted, drResult, drChild;
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);
//Add Relation
DataRelation dRel = new DataRelation("Parent-Child", dtParent.Columns["ParentId"], dtChild.Columns["ParentId"]);
ds.Relations.Add(dRel);
//Excepted result
drExcepted = dtParent.Rows[0];
//Get Result
drChild = dtChild.Select("ParentId=" + drExcepted["ParentId"])[0];
drResult = drChild.GetParentRow("Parent-Child");
// GetParentRow_S
Assert.Equal(drExcepted.ItemArray, drResult.ItemArray);
}