Пример #1
0
        private static void RunTest(BrainTest test, MyProjectRunner projectRunner)
        {
            var brainScan = new BrainScan(projectRunner);
            var step = new StepChecker();

            try
            {
                while (true)
                {
                    projectRunner.RunAndPause(GetIterationStepCount(test, projectRunner.SimulationStep));

                    step.AssertIncreased(projectRunner.SimulationStep);

                    if ((projectRunner.SimulationStep >= test.MaxStepCount) || ShouldStop(test, brainScan))
                        break;
                }

                test.Check(brainScan);
            }
            finally
            {
                //MyLog.WARNING.WriteLine("  simulation step: {0}", projectRunner.SimulationStep);  // TODO(Premek): pass simulation step to the reporter

                projectRunner.Reset();
            }
        }
Пример #2
0
        private void RunTest(BrainTest test, MyProjectRunner projectRunner)
        {
            projectRunner.OpenProject(FindBrainFile(test));
            projectRunner.DumpNodes();

            var brainScan = new BrainScan(projectRunner);

            try
            {
                do
                {
                    projectRunner.RunAndPause(GetIterationStepCount(test, projectRunner.SimulationStep));

                    if (ShouldStop(test, brainScan))
                        break;
                }
                while (projectRunner.SimulationStep < test.MaxStepCount);

                test.Check(brainScan);
            }
            finally
            {
                projectRunner.Reset();
            }
        }