示例#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();
            }
        }
示例#2
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;
        }