Beispiel #1
0
        public void Test_Can_Convert_String()
        {
            IConvertToDatastore mapper = new SqlCompactDBConverter();

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

            Assert.AreEqual("NVARCHAR(200)", type);
        }
Beispiel #2
0
        public void Test_Can_Get_Default()
        {
            IConvertToDatastore mapper = new SqlCompactDBConverter();

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

            Assert.AreEqual("nvarchar(200)", type);
        }
Beispiel #3
0
        public void Test_Can_Convert_Text()
        {
            IConvertToDatastore mapper = new SqlCompactDBConverter();
            string type = mapper.MapType(typeof(string), new Core.Data.DataFieldInfo()
            {
                DataFieldType = Core.Attributes.FieldType.Text
            });

            Assert.AreEqual("ntext", type);
        }
Beispiel #4
0
        public void Test_Can_Convert_char()
        {
            IConvertToDatastore mapper = new SqlCompactDBConverter();

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

            Assert.AreEqual("nvarchar(1)", type);
        }
Beispiel #5
0
        public void Test_Can_Convert_dates()
        {
            IConvertToDatastore mapper = new SqlCompactDBConverter();

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

            Assert.AreEqual("DATETIME", type);
        }
Beispiel #6
0
        public void Test_Can_Convert_Unicode_Char()
        {
            IConvertToDatastore mapper = new SqlCompactDBConverter();
            string type = mapper.MapType(typeof(char), new Core.Data.DataFieldInfo()
            {
                DataFieldType = Core.Attributes.FieldType.UnicodeChar
            });

            Assert.AreEqual("nvarchar(1)", type);
        }
Beispiel #7
0
        public void Test_Can_Convert_Int64()
        {
            IConvertToDatastore mapper = new SqlCompactDBConverter();

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

            Assert.AreEqual("bigint", type);
        }
Beispiel #8
0
        public void Test_Can_Override_String_Length_With_Max()
        {
            IConvertToDatastore mapper = new SqlCompactDBConverter();

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

            Assert.AreEqual("NVARCHAR(MAX)", type);
        }
Beispiel #9
0
        public void Test_Can_Convert_Float()
        {
            IConvertToDatastore mapper = new SqlCompactDBConverter();

            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);
        }