public new void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();

            var converter = new SqlServer.Converters.SqlServerGeographyTypeConverter();
            ColumnDefinition = converter.ColumnDefinition;
        }
示例#2
0
        public new void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();

            var converter = new SqlServer.Converters.SqlServerGeographyTypeConverter();

            ColumnDefinition = converter.ColumnDefinition;
        }
示例#3
0
        public void Can_convert_SqlGeography_to_quoted_string()
        {
            var converter = new SqlServer.Converters.SqlServerGeographyTypeConverter();

            string stringValue = null;
            var    location    = SqlGeography.Parse(stringValue); // NULL
            var    str         = converter.ToQuotedString(typeof(SqlGeography), location);

            Assert.AreEqual($"CAST(null AS {ColumnDefinition})", str);

            stringValue = "POINT(0 0)";
            location    = SqlGeography.Parse(stringValue);
            stringValue = location.ToString(); // to fix any whitespace issues

            str = converter.ToQuotedString(typeof(SqlGeography), location);

            Assert.AreEqual($"CAST('{stringValue}' AS {ColumnDefinition})", str);
        }
        public void Can_convert_SqlGeography_to_quoted_string()
        {
            var converter = new SqlServer.Converters.SqlServerGeographyTypeConverter();

            string stringValue = null;
            var location = SqlGeography.Parse(stringValue); // NULL
            var str = converter.ToQuotedString(typeof(SqlGeography), location);

            Assert.AreEqual($"CAST(null AS {ColumnDefinition})", str);

            stringValue = "POINT(0 0)";
            location = SqlGeography.Parse(stringValue);
            stringValue = location.ToString(); // to fix any whitespace issues

            str = converter.ToQuotedString(typeof(SqlGeography), location);

            Assert.AreEqual($"CAST('{stringValue}' AS {ColumnDefinition})", str);
        }