public void SetUp() { string[] dmDirs = Util.GetDMDirs(); string filename = TestConstant.Model_RBC; WrappedSimulator sim = new EcellCoreLib.WrappedSimulator(dmDirs); _unitUnderTest = new EmlReader(filename, sim); }
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 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."); }
public void TearDown() { _unitUnderTest = null; }
/// <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 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); }
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); }