public virtual void TestTitle() { this.ReportDetail("**** TestTitle"); IThingGraph graph = new ThingGraph(); IThing thing = Factory.CreateItem(); graph.Add(thing); IThing title = Factory.CreateItem("Title1"); var digidoc = new DigidocSchema(graph, thing); // test the new description: digidoc.Title = title; ValidateTitle(digidoc, graph, thing, title); ValidateTitle(digidoc, graph, thing, title); // add same description again: digidoc.Title = title; ValidateTitle(digidoc, graph, thing, title); // the first description will be an orphan: IThing orphan = title; // make a new description: title = Factory.CreateItem("Title2"); digidoc.Title = title; ValidateTitle(digidoc, graph, thing, title); // test if orphan is deleted: Assert.IsFalse(graph.Contains(orphan), "Orphan not deleted"); // take a new schema: digidoc = new DigidocSchema(graph, thing); ValidateTitle(digidoc, graph, thing, title); }
public virtual void TestDescription() { string testName = "TestDescription"; this.ReportDetail(testName); IThingGraph graph = new ThingGraph(); IThing thing = Factory.CreateItem(); graph.Add(thing); IThing description = Factory.CreateItem("Description1"); CommonSchema schema = new CommonSchema(graph, thing); // test the new description: schema.Description = description; ValidateDescription(schema, graph, thing, description); ValidateDescription(schema, graph, thing, description); // add same description again: schema.Description = description; ValidateDescription(schema, graph, thing, description); // the first description will be an orphan: IThing orphan = description; // make a new description: description = Factory.CreateItem("Description2"); schema.Description = description; ValidateDescription(schema, graph, thing, description); // test if orphan is deleted: Assert.IsFalse(graph.Contains(orphan), "Orphan not deleted"); // take a new schema: schema = new CommonSchema(graph, thing); ValidateDescription(schema, graph, thing, description); ReportSummary(); }