Example #1
0
 public void SetUp()
 {
     _env = new ApplicationEnvironment();
     ProjectInfo info = ProjectInfoLoader.Load(TestConstant.Project_Drosophila);
     _unitUnderTest = new Project(info, _env);
     _unitUnderTest.UnLock();
     _unitUnderTest.LoadModel();
 }
Example #2
0
        public void TestConstructorProject()
        {
            _unitUnderTest.Close();

            Project testProject = null;
            Ecell.ProjectInfo info = null;
            try
            {
                testProject = new Project(info, _env);
                testProject.UnLock();
                Assert.Fail("Error param");
            }
            catch (EcellException)
            {
            }
            try
            {
                info = ProjectInfoLoader.Load(TestConstant.Model_Oscillation);
                testProject = new Project(info, null);
                testProject.UnLock();
                Assert.Fail("Error param");
            }
            catch (EcellException)
            {
            }

            info = ProjectInfoLoader.Load(TestConstant.Model_Oscillation);
            testProject = new Project(info, _env);
            testProject.UnLock();
            testProject.LoadModel();
            Assert.IsNotNull(testProject, "Constructor of type, Project failed to create instance.");

            Assert.IsNotEmpty(testProject.DmDic, "DmDic is unexpected value.");

            Assert.IsNotEmpty(testProject.InitialCondition, "InitialCondition is unexpected value.");
            Assert.IsEmpty(testProject.LogableEntityPathDic, "LogableEntityPathDic is unexpected value.");
            testProject.LogableEntityPathDic = new Dictionary<string, string>();
            Assert.IsNotNull(testProject.LogableEntityPathDic, "LogableEntityPathDic is unexpected value.");
            Assert.IsNotEmpty(testProject.LoggerPolicyDic, "LoggerPolicyDic is unexpected value.");
            Assert.IsNotNull(testProject.LoggerPolicy, "LoggerPolicy is unexpected value.");

            Assert.IsNotEmpty(testProject.ModelList, "ModelList is unexpected value.");
            Assert.IsNotNull(testProject.Model, "Model is unexpected value.");
            Assert.IsNotEmpty(testProject.StepperDic, "StepperDic is unexpected value.");
            Assert.IsNotEmpty(testProject.SystemDic, "SystemDic is unexpected value.");
            Assert.IsNotEmpty(testProject.SystemList, "SystemList is unexpected value.");
            Assert.IsNotEmpty(testProject.ProcessList, "ProcessList is unexpected value.");
            Assert.IsNotEmpty(testProject.VariableList, "VariableList is unexpected value.");
            Assert.IsNotEmpty(testProject.TextList, "TextList is unexpected value.");

            Assert.AreEqual(SimulationStatus.Wait, testProject.SimulationStatus, "SimulationStatus is unexpected value.");
            testProject.SimulationStatus = SimulationStatus.Suspended;
            Assert.AreEqual(SimulationStatus.Suspended, testProject.SimulationStatus, "SimulationStatus is unexpected value.");

            Assert.AreEqual(info, testProject.Info, "Info is unexpected value.");
            Assert.IsNotNull(testProject.Simulator, "Simulator is unexpected value.");
            testProject.Simulator = null;
            Assert.IsNull(testProject.Simulator, "Simulator is unexpected value.");

            info = ProjectInfoLoader.Load(TestConstant.Project_Drosophila);
            info.Type = ProjectType.Template;
            testProject = new Project(info, _env);
            testProject.UnLock();
            Assert.AreEqual(info, testProject.Info, "Info is unexpected value.");
        }