CreateForigenConstraint() public static method

public static CreateForigenConstraint ( ) : DataSet
return DataSet
Beispiel #1
0
        public void Add_Constraint()
        {
            DataTable dt = DataProvider.CreateUniqueConstraint();

            Assert.Equal(1, dt.Constraints.Count);
            Assert.Equal("Constraint1", dt.Constraints[0].ConstraintName);

            DataSet ds = DataProvider.CreateForigenConstraint();

            Assert.Equal(1, ds.Tables[1].Constraints.Count);
            Assert.Equal(1, ds.Tables[0].Constraints.Count);

            var arr = new ArrayList(1);

            arr.Add(new ConstraintException());
            TestException(new testExceptionMethodCallback(DataProvider.TryToBreakUniqueConstraint), arr);

            arr = new ArrayList(1);
            arr.Add(new InvalidConstraintException());
            TestException(new testExceptionMethodCallback(DataProvider.TryToBreakForigenConstraint), arr);
        }
        public void DataTableCollection_RemoveAt_I3()
        {
            DataSet ds = DataProvider.CreateForigenConstraint();

            AssertExtensions.Throws <ArgumentException>(null, () => ds.Tables.RemoveAt(0)); //Parent table
        }
Beispiel #3
0
        public void CanRemove_ChildForeign()
        {
            DataSet ds = DataProvider.CreateForigenConstraint();

            Assert.True(ds.Tables["child"].Constraints.CanRemove(ds.Tables["child"].Constraints[0]));
        }
Beispiel #4
0
        public void CanRemove_ParentForeign()
        {
            DataSet ds = DataProvider.CreateForigenConstraint();

            Assert.False(ds.Tables["parent"].Constraints.CanRemove(ds.Tables["parent"].Constraints[0]));
        }