Deveel.Data.CommitTests.OnSetUp C# (CSharp) Method

OnSetUp() protected method

protected OnSetUp ( string testName, IQuery query ) : bool
testName string
query IQuery
return bool
        protected override bool OnSetUp(string testName, IQuery query)
        {
            if (testName.EndsWith("Violation")) {
                CreateTables(query, testName);

                if (testName.Equals("UniqueKeyViolation") ||
                    testName.Equals("PrimaryKeyViolation")) {
                    InsertData(query);
                } else if (testName.Equals("CheckViolation")) {
                    query.AddCheck(new ObjectName("a"),
                        SqlExpression.SmallerOrEqualThan(SqlExpression.Reference(new ObjectName("id")), SqlExpression.Constant(100)));
                }
            }

            return true;
        }