コード例 #1
0
        public void GetComponent()
        {
            IExperiment experiment = ExperimentManager.New();

            experiment.ExperimentInfo.FilePath = "C:\\somefakelocation\\mockExperiment.teml";
            ExperimentNode startNode = experiment.GetNode("Start");

            Assert.IsNotNull(startNode);
            Assert.AreEqual("Start", startNode.ID);
            Assert.IsTrue(startNode is TraceLab.Core.Experiments.ExperimentStartNode);
            ExperimentNode endNode = experiment.GetNode("End");

            Assert.IsNotNull(endNode);
            Assert.AreEqual("End", endNode.ID);
            Assert.IsTrue(endNode is TraceLab.Core.Experiments.ExperimentEndNode);

            ExperimentNode nodeDoesntExist = experiment.GetNode(Guid.NewGuid().ToString());

            Assert.IsNull(nodeDoesntExist);
        }
コード例 #2
0
        public void GetNewComponent()
        {
            IExperiment experiment = ExperimentManager.New();

            experiment.ExperimentInfo.FilePath = "C:\\somefakelocation\\mockExperiment.teml";
            ComponentMetadataDefinition def = new ComponentMetadataDefinition(Guid.NewGuid().ToString(), System.IO.Path.Combine(AppContext.BaseTestDirectory, "Test.dll"), "IDontExist");
            ExperimentNode node             = ((IEditableExperiment)experiment).AddComponentFromDefinition(def, -5, 5);

            ExperimentNode foundNode = experiment.GetNode(node.ID);

            Assert.AreEqual(node, foundNode);
        }
コード例 #3
0
 public ExperimentNode GetNode(string id)
 {
     return(m_experiment.GetNode(id));
 }