public new void TestFixtureSetUp() { base.TestFixtureSetUp(); var converter = new SqlServer.Converters.SqlServerHierarchyIdTypeConverter(); ColumnDefinition = converter.ColumnDefinition; }
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); }