public void Clear2() { DataSet ds = DataProvider.CreateForigenConstraint(); try { ds.Tables[0].Columns.Clear(); Assert.Fail("dccc2#1: Clear failed to throw ArgmentException"); } catch (ArgumentException) {} catch (AssertionException exc) { throw exc; } catch (Exception exc) { Assert.Fail("dccc2#2: Clear. Wrong exception type. Got:" + exc); } }
public void Add_Constraint() { DataTable dt = DataProvider.CreateUniqueConstraint(); Assert.AreEqual(1, dt.Constraints.Count, "ccac#1"); Assert.AreEqual("Constraint1", dt.Constraints[0].ConstraintName, "ccac#2"); DataSet ds = DataProvider.CreateForigenConstraint(); Assert.AreEqual(1, ds.Tables[1].Constraints.Count, "ccac#3"); Assert.AreEqual(1, ds.Tables[0].Constraints.Count, "ccac#4"); ArrayList 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 DataRowCollection_Clear2() { DataSet ds = DataProvider.CreateForigenConstraint(); ds.Tables[0].Rows.Clear(); //Try to clear the parent table }
public void DataTableCollection_RemoveAt_I3() { DataSet ds = DataProvider.CreateForigenConstraint(); ds.Tables.RemoveAt(0); //Parent table }
[Test] public void CanRemove_ChildForeign() { DataSet ds = DataProvider.CreateForigenConstraint(); Assert.AreEqual(true, ds.Tables["child"].Constraints.CanRemove(ds.Tables["child"].Constraints[0]), "CN2"); }
[Test] public void CanRemove_ParentForeign() { DataSet ds = DataProvider.CreateForigenConstraint(); Assert.AreEqual(false, ds.Tables["parent"].Constraints.CanRemove(ds.Tables["parent"].Constraints[0]), "CN1"); }