Beispiel #1
0
        public void GivenItemNameUsedBeforeWhenAddMetaDataItemToDefaultGroupIsCalledThenItemIsUpdated()
        {
            string               defaultGroupName = "DefaultGroupName";
            MetaDataModel        model            = new MetaDataModel(defaultGroupName, Assembly.GetExecutingAssembly());
            List <IMetaDataItem> itemsBefore      = model.GetExportedMetaDataGroupItems(defaultGroupName).ToList();

            Assert.AreEqual(1, itemsBefore.Count);

            string name   = "SomeItemName";
            string value1 = "SomeItemValue1";

            model.AddMetaDataItemToDefaultGroup(name, value1);

            string value2 = "SomeItemValue2";

            model.AddMetaDataItemToDefaultGroup(name, value2);

            List <IMetaDataItem> itemsAfter = model.GetExportedMetaDataGroupItems(defaultGroupName).ToList();

            Assert.AreEqual(2, itemsAfter.Count);
            Assert.AreEqual(itemsBefore[0].Name, itemsAfter[0].Name);
            Assert.AreEqual(itemsBefore[0].Value, itemsAfter[0].Value);
            Assert.AreEqual(name, itemsAfter[1].Name);
            Assert.AreEqual(value2, itemsAfter[1].Value);
        }
Beispiel #2
0
        public void SaveModel(string dsmFilename, bool compressFile, IProgress <ProgressInfo> progress)
        {
            Logger.LogDataModelMessage($"Save data model file={dsmFilename} compresss={compressFile}");

            _metaDataModel.AddMetaDataItemToDefaultGroup("Total elements found", $"{GetExportedElementCount()}");

            DsmModelFile dsmModelFile = new DsmModelFile(dsmFilename, _metaDataModel, _elementsDataModel, _relationsDataModel, _actionsDataModel);

            dsmModelFile.Save(compressFile, progress);
            ModelFilename = dsmFilename;
        }
Beispiel #3
0
        public void Save(string dsiFilename, bool compressFile, IProgress <ProgressInfo> progress)
        {
            Logger.LogDataModelMessage($"Save data model file={dsiFilename} compresss={compressFile}");

            foreach (string type in GetElementTypes())
            {
                _metaDataModel.AddMetaDataItemToDefaultGroup($"- '{type}' elements found", $"{GetElementTypeCount(type)}");
            }
            _metaDataModel.AddMetaDataItemToDefaultGroup("Total elements found", $"{TotalElementCount}");

            foreach (string type in GetRelationTypes())
            {
                _metaDataModel.AddMetaDataItemToDefaultGroup($"- '{type}' relations found", $"{GetRelationTypeCount(type)}");
            }
            _metaDataModel.AddMetaDataItemToDefaultGroup("Total relations found", $"{TotalRelationCount}");
            _metaDataModel.AddMetaDataItemToDefaultGroup("Total relations resolved", $"{ResolvedRelationCount} (confidence={ResolvedRelationPercentage:0.000} %)");

            DsiModelFile modelFile = new DsiModelFile(dsiFilename, _metaDataModel, _elementsDataModel, _relationsDataModel);

            modelFile.Save(compressFile, progress);
        }