Пример #1
0
        public void TestExecuteExperimentLogs()
        {
            var target    = new MockLogTarget();
            var logConfig = new NLog.Config.LoggingConfiguration();

            logConfig.AddTarget("MockLogger", target);
            NLog.LogManager.Configuration = logConfig;

            MockProgress progress = new MockProgress();

            Experiment experiment = LoadExperiment("basic_graph.teml");

            using (var dispatcher = ExperimentRunnerHelper.CreateExperimentRunner(experiment, AppContext.WorkspaceInstance, AppContext.Components))
            {
                dispatcher.ExecuteExperiment(progress);
            }
            // only two nodes log, because the other two are start/end
            Assert.AreEqual(2, target.NumEvents);
        }
        public void TestExecuteExperimentLogs()
        {
            var target = new MockLogTarget();
            var logConfig = new NLog.Config.LoggingConfiguration();
            logConfig.AddTarget("MockLogger", target);
            NLog.LogManager.Configuration = logConfig;

            MockProgress progress = new MockProgress();

            Experiment experiment = LoadExperiment("basic_graph.teml");

            using (var dispatcher = ExperimentRunnerHelper.CreateExperimentRunner(experiment, AppContext.WorkspaceInstance, AppContext.Components))
            {
                dispatcher.ExecuteExperiment(progress);
            }
            // only two nodes log, because the other two are start/end
            Assert.AreEqual(2, target.NumEvents); 
        }