Ejemplo n.º 1
0
        public void CreateTableSql_SingleReferencingModel()
        {
            var sqlEngine = new SqlEngine();

            var createTableSql = sqlEngine.CreateTable(SingleReferencingModel.TableName, SingleReferencingModel.ModelProperties);

            Assert.AreEqual("CREATE TABLE singlereferencingmodels (myreference INTEGER, id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, FOREIGN KEY(myreference) REFERENCES referencedmodels(id));", createTableSql);
        }
Ejemplo n.º 2
0
        public void CreateTableSql_StringPk()
        {
            var sqlEngine = new SqlEngine();

            var createTableSql = sqlEngine.CreateTable(StringPkModel.TableName, StringPkModel.ModelProperties);

            Assert.AreEqual("CREATE TABLE stringpkmodels (id VARCHAR(255) NOT NULL PRIMARY KEY);", createTableSql);
        }
Ejemplo n.º 3
0
        public void CreateTableSql_MixedTypeModel()
        {
            var sqlEngine = new SqlEngine();

            var createTableSql = sqlEngine.CreateTable(MixedType.TableName, MixedType.ModelProperties);

            Assert.AreEqual("CREATE TABLE mixedtypes (myattribute1 TEXT, myattribute2 INTEGER, myattribute3 BLOB, id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT);", createTableSql);
        }
Ejemplo n.º 4
0
        public void CreateTableSql_UniqueValueModel()
        {
            var sqlEngine = new SqlEngine();

            var createTableSql = sqlEngine.CreateTable(UniqueValue.TableName, UniqueValue.ModelProperties);

            Assert.AreEqual("CREATE TABLE uniquevalues (myattribute VARCHAR(255) UNIQUE, id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT);", createTableSql);
        }
Ejemplo n.º 5
0
        public void CreateTableSql_SingleReferencingModel()
        {
            var sqlEngine = new SqlEngine();

            var createTableSql = sqlEngine.CreateTable(SingleReferencingModel.TableName, SingleReferencingModel.ModelProperties);

            Assert.AreEqual("CREATE TABLE singlereferencingmodels (myreference int FOREIGN KEY REFERENCES referencedmodels(id), id int IDENTITY(1,1) PRIMARY KEY);", createTableSql);
        }
Ejemplo n.º 6
0
        public void CreateTableSql_MultipleStringModel()
        {
            var sqlEngine = new SqlEngine();

            var createTableSql = sqlEngine.CreateTable(MultipleString.TableName, MultipleString.ModelProperties);

            Assert.AreEqual("CREATE TABLE multiplestrings (myattribute1 TEXT, myattribute2 TEXT, myattribute3 TEXT, id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT);", createTableSql);
        }
Ejemplo n.º 7
0
        public void CreateTableSql_UniqueValueModel()
        {
            var sqlEngine = new SqlEngine();

            var createTableSql = sqlEngine.CreateTable(UniqueValue.TableName, UniqueValue.ModelProperties);

            Assert.AreEqual("CREATE TABLE uniquevalues (myattribute Nvarchar(255) UNIQUE, id int IDENTITY(1,1) PRIMARY KEY);", createTableSql);
        }
Ejemplo n.º 8
0
        public void CreateTableSql_MixedTypeModel()
        {
            var sqlEngine = new SqlEngine();

            var createTableSql = sqlEngine.CreateTable(MixedType.TableName, MixedType.ModelProperties);

            Assert.AreEqual("CREATE TABLE mixedtypes (myattribute1 Nvarchar(max), myattribute2 int, myattribute3 binary, id int IDENTITY(1,1) PRIMARY KEY);", createTableSql);
        }
Ejemplo n.º 9
0
        public void CreateTableSql_MultipleStringModel()
        {
            var sqlEngine = new SqlEngine();

            var createTableSql = sqlEngine.CreateTable(MultipleString.TableName, MultipleString.ModelProperties);

            Assert.AreEqual("CREATE TABLE multiplestrings (myattribute1 Nvarchar(max), myattribute2 Nvarchar(max), myattribute3 Nvarchar(max), id int IDENTITY(1,1) PRIMARY KEY);", createTableSql);
        }
Ejemplo n.º 10
0
        public void CreateTableSql_SingleStringModel()
        {
            var sqlEngine = new SqlEngine();

            var createTableSql = sqlEngine.CreateTable(SingleString.TableName, SingleString.ModelProperties);

            Assert.AreEqual("CREATE TABLE singlestrings (myattribute TEXT, id INTEGER PRIMARY KEY AUTOINCREMENT);", createTableSql);
        }
Ejemplo n.º 11
0
        public void CreateTableSql_MultipleReferencingModel()
        {
            var sqlEngine = new SqlEngine();

            var createTableSql = sqlEngine.CreateTable(MultipleReferencingModel.TableName, MultipleReferencingModel.ModelProperties);

            Assert.AreEqual("CREATE TABLE multiplereferencingmodels (myreference1 INTEGER, myreference2 INTEGER, id INTEGER PRIMARY KEY AUTOINCREMENT, "
                            + "FOREIGN KEY(myreference1) REFERENCES referencedmodels(id), FOREIGN KEY(myreference2) REFERENCES referencedmodels(id));", createTableSql);
        }