Esempio n. 1
0
        public void HIERARCHYID_Data_ScriptsCorrectly()
        {
            SqlHierarchyId baseData = SqlHierarchyId.Parse("/");
            object         data     = baseData;

            var fieldInfo = SchemaScriptingTests.FakeColumn("test", "test", 20, "sys.junk.hierarchyid", false, 0, 0);

            Assert.AreEqual("0x", FieldScripting.valueAsTSQLLiteral(data, fieldInfo), "hierarchyid");
            Assert.AreEqual("0x", FieldScripting.formatHierarchyId(data), "hierarchyid");

            baseData  = SqlHierarchyId.Parse("/1/");
            data      = baseData;
            fieldInfo = SchemaScriptingTests.FakeColumn("test", "test", 20, "sys.junk.hierarchyid", false, 0, 0);
            Assert.AreEqual("0x58", FieldScripting.valueAsTSQLLiteral(data, fieldInfo), "hierarchyid");
            Assert.AreEqual("0x58", FieldScripting.formatHierarchyId(data), "hierarchyid");
        }