public void SchEd_WriterCalling_ReCreatePropertyType() { Test(() => { SchemaEditor ed1 = new SchemaEditor(); SchemaEditor ed2 = new SchemaEditor(); SchemaEditorAccessor ed2Acc = new SchemaEditorAccessor(ed2); TestSchemaWriter wr = new TestSchemaWriter(); //-- create original ed1.CreatePropertyType("PT1", DataType.String); SetSchemaItemId(ed1.PropertyTypes["PT1"], 1); //-- create current ed2.CreatePropertyType("PT1", DataType.String); SetSchemaItemId(ed2.PropertyTypes["PT1"], 1); //-- edit ed2.DeletePropertyType(ed2.PropertyTypes["PT1"]); ed2.CreatePropertyType("PT1", DataType.String); //-- register ed2Acc.RegisterSchema(ed1, wr); //-- test string log = wr.Log.Replace("\r\n", ""); Assert.IsTrue(log == "Open();CreatePropertyType(name=<PT1>, dataType=<String>, isContentListProperty=<False>);DeletePropertyType(propertyType=<PT1>);Close();"); }); }
public void SchemaWriter_DeletePropertyType() { IntegrationTest(() => { var ed = new SchemaEditor(); ed.Load(); var propertyTypeCountBefore = ed.PropertyTypes.Count; var propertyTypeName = "PT1-" + Guid.NewGuid(); var mapping = GetNextMapping(ed, false); ed.CreatePropertyType(propertyTypeName, DataType.String, mapping); ed.Register(); Assert.AreEqual(propertyTypeCountBefore + 1, StorageSchema.PropertyTypes.Count); Assert.IsNotNull(StorageSchema.PropertyTypes[propertyTypeName]); // ACTION ed = new SchemaEditor(); ed.Load(); ed.DeletePropertyType(ed.PropertyTypes[propertyTypeName]); ed.Register(); // ASSERT Assert.AreEqual(propertyTypeCountBefore, StorageSchema.PropertyTypes.Count); Assert.IsNull(StorageSchema.PropertyTypes[propertyTypeName]); }); }
public void SchemaEditor_ModifyPropertySlot_RemoveProtected() { //-- vedett elem torlese SchemaEditor editor = new SchemaEditor(); PropertyType slot = editor.CreatePropertyType("slot1", DataType.String, 0); NodeType nt = editor.CreateNodeType(null, "NodeType1", "class"); editor.AddPropertyTypeToPropertySet(slot, nt); editor.DeletePropertyType(slot); }
public void SchemaEditor_RemovePropertySlot() { SchemaEditor editor = new SchemaEditor(); PropertyType slot = editor.CreatePropertyType("slot1", DataType.String, 0); NodeType nt = editor.CreateNodeType(null, "NodeType1", "class"); editor.AddPropertyTypeToPropertySet(slot, nt); slot = editor.PropertyTypes["slot1"]; editor.DeletePropertyType(slot); }
public void SchemaEditor_RemovePropertySlot_WrongContext() { //-- hiba: rossz context (ket SchemaEditor) SchemaEditor editor1 = new SchemaEditor(); SchemaEditor editor2 = new SchemaEditor(); editor1.CreatePropertyType("slot", DataType.String, 0); editor2.CreatePropertyType("slot", DataType.String, 1); PropertyType slot = editor1.PropertyTypes["slot"]; editor2.DeletePropertyType(slot); }
public void SchEd_WriterCalling_ReCreatePropertyType() { SchemaEditor ed1 = new SchemaEditor(); SchemaEditor ed2 = new SchemaEditor(); SchemaEditorAccessor ed2Acc = new SchemaEditorAccessor(ed2); TestSchemaWriter wr = new TestSchemaWriter(); //-- create original ed1.CreatePropertyType("PT1", DataType.String); SetSchemaItemId(ed1.PropertyTypes["PT1"], 1); //-- create current ed2.CreatePropertyType("PT1", DataType.String); SetSchemaItemId(ed2.PropertyTypes["PT1"], 1); //-- edit ed2.DeletePropertyType(ed2.PropertyTypes["PT1"]); ed2.CreatePropertyType("PT1", DataType.String); //-- register ed2Acc.RegisterSchema(ed1, wr); //-- test string log = wr.Log.Replace("\r\n", ""); Assert.IsTrue(log == "Open();CreatePropertyType(name=<PT1>, dataType=<String>, mapping=<0>, isContentListProperty=<False>);DeletePropertyType(propertyType=<PT1>);Close();"); }