Example #1
0
 public void SetUp()
 {
     string[] dmDirs = Util.GetDMDirs();
     string filename = TestConstant.Model_RBC;
     WrappedSimulator sim = new EcellCoreLib.WrappedSimulator(dmDirs);
     _unitUnderTest = new EmlReader(filename, sim);
 }
Example #2
0
        public void TestParse()
        {
            EcellObject expectedEcellObject = _unitUnderTest.Parse();
            EcellObject resultEcellObject = null;

            string[] dmDirs = Util.GetDMDirs();
            string filename = TestConstant.Model_RBC;
            WrappedSimulator sim = new EcellCoreLib.WrappedSimulator(dmDirs);
            EmlReader testEmlReader = new EmlReader(filename, sim);

            resultEcellObject = testEmlReader.Parse();
            Assert.AreEqual(expectedEcellObject, resultEcellObject, "Parse method returned unexpected result.");
        }
Example #3
0
 public void TestConstructorEmlReader()
 {
     string[] dmDirs = Util.GetDMDirs();
     string filename = TestConstant.Model_RBC;
     WrappedSimulator sim = new EcellCoreLib.WrappedSimulator(dmDirs);
     EmlReader testEmlReader = new EmlReader(filename, sim);
     Assert.IsNotNull(testEmlReader, "Constructor of type, EmlReader failed to create instance.");
 }
Example #4
0
 public void TearDown()
 {
     _unitUnderTest = null;
 }
Example #5
0
 /// <summary>
 /// Parses the "eml" formatted file.
 /// </summary>
 /// <param name="fileName">The "eml" formatted file</param>
 /// <param name="sim">Simulator instance</param>
 public static EcellModel Parse(string fileName, WrappedSimulator sim)
 {
     EmlReader reader = new EmlReader(fileName, sim);
     EcellModel model = reader.Parse();
     InitializeModel(model, sim);
     return model;
 }
Example #6
0
        public void TestWrite()
        {
            string[] dmDirs = Util.GetDMDirs();
            WrappedSimulator sim = new EcellCoreLib.WrappedSimulator(dmDirs);
            EmlReader testEmlReader = new EmlReader(TestConstant.Model_RBC, sim);
            EcellObject model = testEmlReader.Parse();

            List<EcellObject> storedList = model.Children;
            _unitUnderTest.Write(storedList);
        }
Example #7
0
        public void TestCreate()
        {
            _unitUnderTest.Close();
            string[] dmDirs = Util.GetDMDirs();
            WrappedSimulator sim = new EcellCoreLib.WrappedSimulator(dmDirs);
            EmlReader testEmlReader = new EmlReader(TestConstant.Model_Oscillation, sim);
            EcellObject model = testEmlReader.Parse();

            List<EcellObject> storedList = model.Children;
            bool isProjectSave = true;
            EmlWriter.Create(_filename, storedList, isProjectSave);
            EmlWriter.Create(_filename + Constants.FileExtBackUp, storedList, isProjectSave);
        }