Exemplo n.º 1
0
        /// <summary>
        /// Create a new instance of this class
        /// </summary>
        /// <param name="view">The view to use</param>
        /// <param name="project">The project</param>
        /// <param name="isNewProject">Indicates if the project was newly created</param>
        /// <param name="projectManager">The project manager to use</param>
        /// <param name="runner">The rule runner to use</param>
        /// <param name="violationList">The violation list to sue</param>
        public MainController(IMainView view,
                              ICalidusProjectModel project,
                              bool isNewProject,
                              ICalidusProjectManager projectManager,
                              IRuleRunner runner,
                              IRuleViolationList violationList)
        {
            _view = view;

            _view.Open += new EventHandler <EventArgs>(_view_Open);
            _view.Save += new EventHandler <EventArgs>(_view_Save);
            _view.Quit += new EventHandler <QuitEventArgs>(_view_Quit);

            _view.ProjectConfiguration += new EventHandler <EventArgs>(_view_ProjectConfiguration);
            _view.RuleConfiguration    += new EventHandler <EventArgs>(_view_RuleConfiguration);

            _projectManager = projectManager;

            _runner            = runner;
            _runner.Started   += new EventHandler <EventArgs>(_runner_Started);
            _runner.Completed += new EventHandler <RuleRunnerEventArgs>(_runner_Completed);

            _violationList = violationList;

            _project             = project;
            _project.Changed    += new EventHandler <EventArgs>(_project_Changed);
            _project.ProjectSet += new EventHandler <EventArgs>(_project_ProjectSet);

            //set project details
            _view.SelectedProject = _project.GetProjectFile();
            HasChanges            = isNewProject;
        }
Exemplo n.º 2
0
        public override void SetUp()
        {
            base.SetUp();

            _view          = Mocker.DynamicMock <IRuleRunnerView>();
            _runner        = Mocker.DynamicMock <IRuleRunner>();
            _projectModel  = Mocker.DynamicMock <ICalidusProjectModel>();
            _configFactory = Mocker.DynamicMock <ICalidusRuleConfigurationFactory>();
        }
Exemplo n.º 3
0
        public void SetUp()
        {
            _helper = new EnumerableHelper();

            _mocks = new MockRepository();

            _fileRetriever = _mocks.StrictMock<IFileRetriever>();
            _ruleRetriever = _mocks.StrictMock<IRuleRetriever>();
            _ruleRunner = new RuleRunner(_fileRetriever, _ruleRetriever);
        }
Exemplo n.º 4
0
        public override void SetUp()
        {
            base.SetUp();

            _view = Mocker.DynamicMock <IMainView>();

            _projectModel = Mocker.DynamicMultiMock <ICalidusProjectModel>();

            _projectManager = Mocker.DynamicMultiMock <ICalidusProjectManager>();
            _ruleRunner     = Mocker.DynamicMock <IRuleRunner>();
            _violationList  = Mocker.DynamicMultiMock <IRuleViolationList>();
        }
        public SolutionCheckerViewmodel(IShellService shellService, IProjectManager projectManager, IRuleRunner ruleRunner)
            : base(shellService)
        {
            _projectManager = projectManager;
            _ruleRunner = ruleRunner;

            _projectManager.Load(OnLoaded);

            _ruleRunner.LoadRunLog(OnLogLoaded);

            _ruleRunner.RunLogAdded += _ruleRunner_RunLogAdded;
        }
Exemplo n.º 6
0
        /// <summary>
        /// Create a new instance of this class
        /// </summary>
        /// <param name="view">The view to use</param>
        /// <param name="runner">The runner to use</param>
        /// <param name="project">The projectmodel to use</param>
        public RuleRunnerController(IRuleRunnerView view, IRuleRunner runner, ICalidusProjectModel project, ICalidusRuleConfigurationFactory configFactory)
        {
            _view = view;
            _view.RuleRunnerStart += new EventHandler <EventArgs>(_view_RuleRunnerStart);

            _runner = runner;
            _runner.FileCompleted += new EventHandler <FileCompletedEventArgs>(_runner_FileCompleted);

            _project = project;

            _configFactory = configFactory;
        }
Exemplo n.º 7
0
        public void MainControllerShouldSetViewSelectedProjectToProjectFileName()
        {
            IMainView              view           = Mocker.DynamicMock <IMainView>();
            ICalidusProjectModel   projectModel   = Mocker.DynamicMultiMock <ICalidusProjectModel>(typeof(ICalidusProject));
            ICalidusProjectManager projectManager = Mocker.DynamicMock <ICalidusProjectManager>();
            IRuleRunner            ruleRunner     = Mocker.DynamicMock <IRuleRunner>();
            IRuleViolationList     violationList  = Mocker.DynamicMock <IRuleViolationList>();

            //Expect.Call(view.SelectedProject = @"c:\test.calidus").Repeat.Once();
            Expect.Call(projectModel.GetProjectFile()).Return(@"c:\test.calidus").Repeat.Once();

            Mocker.ReplayAll();

            MainController controller = new MainController(view, projectModel, false, projectManager, ruleRunner, violationList);

            Mocker.VerifyAll();
        }
Exemplo n.º 8
0
 public ValidateFieldEndpoint(RemoteRuleGraph graph, IRuleRunner rules, IAjaxContinuationResolver continuation)
 {
     _graph        = graph;
     _rules        = rules;
     _continuation = continuation;
 }
Exemplo n.º 9
0
 public ValidateFieldEndpoint(RemoteRuleGraph graph, IRuleRunner rules, IAjaxContinuationResolver continuation)
 {
     _graph = graph;
     _rules = rules;
     _continuation = continuation;
 }