コード例 #1
0
        public new void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();

            var converter = new SqlServer.Converters.SqlServerHierarchyIdTypeConverter();
            ColumnDefinition = converter.ColumnDefinition;
        }
コード例 #2
0
        public new void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();

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

            ColumnDefinition = converter.ColumnDefinition;
        }
コード例 #3
0
        public void Can_convert_hierarchyid_to_quoted_string()
        {
            var converter = new SqlServer.Converters.SqlServerHierarchyIdTypeConverter();

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

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

            stringValue = "/1/1/3/";
            hierarchyId = SqlHierarchyId.Parse(stringValue); // 0x5ADE
            str         = converter.ToQuotedString(typeof(SqlHierarchyId), hierarchyId);

            Assert.AreEqual($"CAST('{stringValue}' AS {ColumnDefinition})", str);
        }
コード例 #4
0
        public void Can_convert_hierarchyid_to_quoted_string()
        {
            var converter = new SqlServer.Converters.SqlServerHierarchyIdTypeConverter();

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

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

            stringValue = "/1/1/3/";
            hierarchyId = SqlHierarchyId.Parse(stringValue); // 0x5ADE
            str = converter.ToQuotedString(typeof(SqlHierarchyId), hierarchyId);

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