public void Given_MetaDataIsPresent_When_ModelIsCleared_Then_OnlyDefaultGroupAndItemsArePresent() { string defaultGroupName = "DefaultGroupName"; MetaDataModel model = new MetaDataModel(defaultGroupName, Assembly.GetExecutingAssembly()); string groupName = "ImportedGroupName"; string name1 = "SomeItemName1"; string value1 = "SomeItemValue2"; model.AddMetaDataItem(groupName, name1, value1); string name2 = "SomeItemName"; string value2 = "SomeItemValue1"; model.AddMetaDataItem(groupName, name2, value2); List <string> groupsBefore = model.GetExportedMetaDataGroups().ToList(); Assert.AreEqual(2, groupsBefore.Count); model.Clear(); List <string> groupsAfter = model.GetExportedMetaDataGroups().ToList(); Assert.AreEqual(1, groupsAfter.Count); List <IMetaDataItem> items = model.GetExportedMetaDataGroupItems(defaultGroupName).ToList(); Assert.AreEqual(1, items.Count); Assert.IsTrue(items[0].Name == "Executable"); Assert.IsTrue(items[0].Value.Contains("DsmSuite.Common.Model.Test")); }
public void Clear() { _metaDataModel.Clear(); _elementsDataModel.Clear(); _relationsDataModel.Clear(); }