コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }