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."); }
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); }
/// <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; }
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); }