コード例 #1
0
        public RunTestsEngine(string containerFilePath)
        {
            _containerFilePath    = containerFilePath;
            _testsContainerEntity = LoadTestContainer(_containerFilePath);

            // Need to setup any test assemblies
            foreach (var testAssy in _testsContainerEntity.DescendantsAndSelf <TestAssemblyEntity>())
            {
                Model.Instance.Session.RegisterTestAssembly(testAssy);
            }

            _taskController = new AppTaskController(Model.Instance, Model.Instance.Session.BaseTasksFolderPath)
            {
                MaxConcurrentTasks = 1,
            };
            _taskController.TaskStarted   += new AppTaskEventHandler(TaskController_TaskStarted);
            _taskController.TaskCompleted += new AppTaskEventHandler(TaskController_TaskCompleted);

            _normalConsoleColor = Console.ForegroundColor;
        }
コード例 #2
0
ファイル: AppTask.cs プロジェクト: sahilagnihotri/Chess
        internal void Register(IAppTaskController controller, int taskID)
        {
            if (controller == null)
            {
                throw new ArgumentNullException("controller");
            }
            if (taskID <= 0)
            {
                throw new ArgumentOutOfRangeException("taskID", taskID, "ID must be greater than zero.");
            }
            if (this.Controller != null)
            {
                throw new InvalidOperationException("This task has already been registered.");
            }
            if (this.ID.HasValue && taskID != ID)
            {
                throw new InvalidOperationException("This task already has a task ID and the 'taskID' parameter is different. Cannot change the task ID once assigned.");
            }

            Controller = controller;
            ID         = taskID;
        }