AssertForeignKeyConstraint() public method

public AssertForeignKeyConstraint ( string label, ForeignKeyConstraint fk, string name, AcceptRejectRule acceptRejectRule, Rule delRule, Rule updateRule, string colNames, string relColNames ) : void
label string
fk ForeignKeyConstraint
name string
acceptRejectRule AcceptRejectRule
delRule Rule
updateRule Rule
colNames string
relColNames string
return void
示例#1
0
        private void ReadTest1Check(DataSet ds)
        {
            DataSetAssertion.AssertDataSet("dataset", ds, "NewDataSet", 2, 1);
            DataSetAssertion.AssertDataTable("tbl1", ds.Tables[0], "Table1", 3, 0, 0, 1, 1, 0);
            DataSetAssertion.AssertDataTable("tbl2", ds.Tables[1], "Table2", 3, 0, 1, 0, 1, 0);

            DataRelation rel = ds.Relations[0];

            DataSetAssertion.AssertDataRelation("rel", rel, "Rel1", false,
                                                new string[] { "Column1_3" },
                                                new string[] { "Column2_1" }, true, true);
            DataSetAssertion.AssertUniqueConstraint("uc", rel.ParentKeyConstraint,
                                                    "Constraint1", false, new string[] { "Column1_3" });
            DataSetAssertion.AssertForeignKeyConstraint("fk", rel.ChildKeyConstraint, "Rel1",
                                                        AcceptRejectRule.None, Rule.Cascade, Rule.Cascade,
                                                        new string[] { "Column2_1" },
                                                        new string[] { "Column1_3" });
        }
示例#2
0
        public void ConflictColumnTable()
        {
            DataSet ds = GetDataSet(_xml19, null);

            DataSetAssertion.AssertDataSet("ds", ds, "set", 2, 1);

            DataTable dt = ds.Tables[0];

            DataSetAssertion.AssertDataTable("dt", dt, "table", 1, 0, 0, 1, 1, 1);
            DataSetAssertion.AssertDataColumn("table_Id", dt.Columns[0], "table_Id", false, true, 0, 1, "table_Id", MappingType.Hidden, typeof(int), DBNull.Value, string.Empty, -1, string.Empty, 0, string.Empty, false, true);

            dt = ds.Tables[1];
            DataSetAssertion.AssertDataTable("dt", dt, "col", 2, 0, 1, 0, 1, 0);
            DataSetAssertion.AssertDataColumn("table_refId", dt.Columns["table_Id"], "table_Id", true, false, 0, 1, "table_Id", MappingType.Hidden, typeof(int), DBNull.Value, string.Empty, -1, string.Empty, /*0*/ -1, string.Empty, false, false);
            DataSetAssertion.AssertDataColumn("another_col", dt.Columns["another_col"], "another_col", true, false, 0, 1, "another_col", MappingType.Element, typeof(string), DBNull.Value, string.Empty, -1, string.Empty, /*1*/ -1, string.Empty, false, false);

            DataRelation dr = ds.Relations[0];

            DataSetAssertion.AssertDataRelation("rel", dr, "table_col", true, new string[] { "table_Id" }, new string[] { "table_Id" }, true, true);
            DataSetAssertion.AssertUniqueConstraint("uniq", dr.ParentKeyConstraint, "Constraint1", true, new string[] { "table_Id" });
            DataSetAssertion.AssertForeignKeyConstraint("fkey", dr.ChildKeyConstraint, "table_col", AcceptRejectRule.None, Rule.Cascade, Rule.Cascade, new string[] { "table_Id" }, new string[] { "table_Id" });
        }