示例#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);
 }
示例#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.");
        }
示例#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.");
 }
示例#4
0
 public void TearDown()
 {
     _unitUnderTest = null;
 }
示例#5
0
文件: Eml.cs 项目: ecell/ecell3-ide
 /// <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;
 }
示例#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);
        }
示例#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);
        }