Exemplo n.º 1
0
        public void performTest2()
        {
            log("***************TEST 2********************");

            MotivationModel mm = createExampleMM();
            string          id = "MotivationAssessmentTestId.xml";

            writeMMToFile(id, mm);

            MotivationAssessmentAssetSettings maass = new MotivationAssessmentAssetSettings();

            maass.XMLLoadingId = id;
            getMAsA().Settings = maass;
            MotivationModel mm2 = getMAsA().loadMotivationModel();

            if (mm.toXmlString().Equals(mm2.toXmlString()))
            {
                log("MotivationModels before and after the loading are identically!");
            }
            else
            {
                log("MotivationModels before and after the loading are NOT identically!", Severity.Error);
                Assert.Fail();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Method for storing a Motivation Model as XML in a file.
        /// </summary>
        /// <param name="fileId"> File-Id for storing the model. </param>
        /// <param name="mm"> The Motivation model to store. </param>
        internal void writeMMToFile(string fileId, MotivationModel mm)
        {
            IDataStorage ids = (IDataStorage)AssetManager.Instance.Bridge;

            if (ids != null)
            {
                log("Storing DomainModel to File.");
                ids.Save(fileId, mm.toXmlString());
            }
            else
            {
                log("No IDataStorage - Bridge implemented!", Severity.Error);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Method for setting the motivation model
        /// </summary>
        /// <param name="mm"> The motivation model to load</param>
        public void setMotivationModel(MotivationModel mm)
        {
            string fileId = "MotivationAssessmentAssetTestId.xml";

            IDataStorage ids = (IDataStorage)AssetManager.Instance.Bridge;

            if (ids != null)
            {
                log("Storing DomainModel to File.");
                ids.Save(fileId, mm.toXmlString());
            }
            else
            {
                log("No IDataStorage - Bridge implemented!", Severity.Warning);
            }

            //change Settings to load local file
            MotivationAssessmentAssetSettings newMAS = new MotivationAssessmentAssetSettings();

            newMAS.XMLLoadingId = fileId;
            ((MotivationAssessmentAsset)AssetManager.Instance.findAssetByClass("MotivationAssessmentAsset")).Settings = newMAS;
        }