Exemple #1
0
        public void Test_Can_Convert_Unicode_String()
        {
            IConvertToDatastore mapper = new SqlServerDBConverter();
            string type = mapper.MapType(typeof(string), new Core.Data.DataFieldInfo()
            {
                DataFieldType = Core.Attributes.FieldType.UnicodeString
            });

            Assert.AreEqual("nvarchar(200)", type);
        }
Exemple #2
0
        public void Test_Can_Convert_String()
        {
            IConvertToDatastore mapper = new SqlServerDBConverter();

            string type = mapper.MapType(typeof(string), new Core.Data.DataFieldInfo()
            {
            });

            Assert.AreEqual("varchar(200)", type);
        }
Exemple #3
0
        public void Test_Can_Get_Default()
        {
            IConvertToDatastore mapper = new SqlServerDBConverter();

            string type = mapper.MapType(this.GetType(), new Core.Data.DataFieldInfo()
            {
            });

            Assert.AreEqual("varchar(200)", type);
        }
Exemple #4
0
        public void Test_Can_Convert_Text()
        {
            IConvertToDatastore mapper = new SqlServerDBConverter();
            string type = mapper.MapType(typeof(string), new Core.Data.DataFieldInfo()
            {
                DataFieldType = Core.Attributes.FieldType.Text
            });

            Assert.AreEqual("TEXT", type);
        }
Exemple #5
0
        public void Test_Can_Convert_timespan()
        {
            IConvertToDatastore mapper = new SqlServerDBConverter();

            string type = mapper.MapType(typeof(TimeSpan), new Core.Data.DataFieldInfo()
            {
            });

            Assert.AreEqual("time(7)", type);
        }
Exemple #6
0
        public void Test_Can_Convert_dates()
        {
            IConvertToDatastore mapper = new SqlServerDBConverter();

            string type = mapper.MapType(typeof(DateTime), new Core.Data.DataFieldInfo()
            {
            });

            Assert.AreEqual("DATETIME", type);
        }
Exemple #7
0
        public void Test_Can_Convert_Bool()
        {
            IConvertToDatastore mapper = new SqlServerDBConverter();

            string type = mapper.MapType(typeof(bool), new Core.Data.DataFieldInfo()
            {
            });

            Assert.AreEqual("bit", type);
        }
Exemple #8
0
        public void Test_Can_Convert_ByteArray()
        {
            IConvertToDatastore mapper = new SqlServerDBConverter();

            string type = mapper.MapType(typeof(byte[]), new Core.Data.DataFieldInfo()
            {
            });

            Assert.AreEqual("varbinary(MAX)", type);
        }
Exemple #9
0
        public void Test_Can_Override_String_Length_With_Max()
        {
            IConvertToDatastore mapper = new SqlServerDBConverter();

            string type = mapper.MapType(typeof(string), new Core.Data.DataFieldInfo()
            {
                FieldLength = Int32.MaxValue
            });

            Assert.AreEqual("varchar(MAX)", type);
        }
Exemple #10
0
        public void Test_Can_Convert_Float()
        {
            IConvertToDatastore mapper = new SqlServerDBConverter();

            string type = mapper.MapType(typeof(double), new Core.Data.DataFieldInfo()
            {
            });

            Assert.AreEqual("real", type);

            type = mapper.MapType(typeof(float), new Core.Data.DataFieldInfo()
            {
            });
            Assert.AreEqual("real", type);

            type = mapper.MapType(typeof(decimal), new Core.Data.DataFieldInfo()
            {
            });
            Assert.AreEqual("Money", type);
        }