public void SetNullOnDeleteViolation() { var expected = Is.InstanceOf <ConstraintViolationException>() .And.TypeOf <NotNullColumnViolationException>() .And.Property("TableName").EqualTo(ObjectName.Parse("APP.test_table2")) .And.Property("ColumnName").EqualTo("person_id"); Assert.Throws(expected, () => AdminQuery.AddForeignKey(ObjectName.Parse("test_table2"), new[] { "person_id" }, ObjectName.Parse("test_table"), new[] { "id" }, ForeignKeyAction.SetNull, ForeignKeyAction.NoAction)); }