[Test] public void Equals()
{
DataSet ds = new DataSet();
DataTable dtParent = DataProvider.CreateParentDataTable();
DataTable dtChild = DataProvider.CreateChildDataTable();
ds.Tables.Add(dtParent);
ds.Tables.Add(dtChild);
dtParent.PrimaryKey = new DataColumn[] {dtParent.Columns[0]};
ds.EnforceConstraints = true;
ForeignKeyConstraint fc1,fc2;
fc1 = new ForeignKeyConstraint(dtParent.Columns[0],dtChild.Columns[0]);
fc2 = new ForeignKeyConstraint(dtParent.Columns[0],dtChild.Columns[1]);
// different columnn
Assert.AreEqual(false, fc1.Equals(fc2), "FKC3");
//Two System.Data.ForeignKeyConstraint are equal if they constrain the same columns.
// same column
fc2 = new ForeignKeyConstraint(dtParent.Columns[0],dtChild.Columns[0]);
Assert.AreEqual(true, fc1.Equals(fc2), "FKC4");
}