Пример #1
0
 public void UnpackDbType2Test()
 {
     string rawType = "int(12)";
     IDataType dataType = new SchemaLoader.DataType();
     dataType.UnpackRawDbType(rawType);
     Assert.AreEqual("int", dataType.SqlType);
     Assert.AreEqual(12, dataType.Length);
     Assert.AreEqual(12, dataType.Precision);
     Assert.AreEqual(null, dataType.Scale);
     //Assert.AreEqual(null, dataType.Unsigned); // irrelevant
 }
Пример #2
0
 public void UnpackDbType3Test()
 {
     string rawType = "number(15,5)";
     IDataType dataType = new SchemaLoader.DataType();
     dataType.UnpackRawDbType(rawType);
     Assert.AreEqual("number", dataType.SqlType);
     Assert.AreEqual(15, dataType.Length);
     Assert.AreEqual(15, dataType.Precision);
     Assert.AreEqual(5, dataType.Scale);
     Assert.AreEqual(false, dataType.Unsigned);
 }
Пример #3
0
 public void UnpackDbType4Test()
 {
     string rawType = "type()";
     IDataType dataType = new SchemaLoader.DataType();
     dataType.UnpackRawDbType(rawType);
     Assert.AreEqual("type", dataType.SqlType);
     Assert.AreEqual(null, dataType.Length);
     Assert.AreEqual(null, dataType.Precision);
     Assert.AreEqual(null, dataType.Scale);
 }
Пример #4
0
 public void UnpackDbType5Test()
 {
     string rawType = "smallint unsigned";
     IDataType dataType = new SchemaLoader.DataType();
     dataType.UnpackRawDbType(rawType);
     Assert.AreEqual("smallint", dataType.SqlType);
     Assert.AreEqual(null, dataType.Length);
     Assert.AreEqual(null, dataType.Precision);
     Assert.AreEqual(null, dataType.Scale);
     Assert.AreEqual(true, dataType.Unsigned);
 }