public void SetUp()
        {
            viewMock            = MockRepository.StrictMock <IProjectTreeView>();
            dataLayerMock       = MockRepository.StrictMock <IDataLayer>();
            eventDispatcherMock = MockRepository.StrictMock <IEventDispatcher>();
            settingsMock        = MockRepository.StrictMock <ISettings>();
            loggerFactoryMock   = MockRepository.DynamicMock <ILoggerFactory>();
            loggerFactoryMock.Stub(x => x.GetLogger(null)).IgnoreArguments().Return(MockRepository.Stub <ILogger>());

            controller = new ProjectTreeController(loggerFactoryMock, dataLayerMock, settingsMock, eventDispatcherMock);
        }
        public void ModelChangedImportantChanges()
        {
            Expect.Call(() => eventDispatcherMock.ModelChanged += null).IgnoreArguments();
            var modelChangedRaiser = LastCall.GetEventRaiser();

            Expect.Call(viewMock.Controller).PropertyBehavior();
            Expect.Call(viewMock.UpdateData);

            MockRepository.ReplayAll();

            controller = new ProjectTreeController(loggerFactoryMock, dataLayerMock, settingsMock, eventDispatcherMock);
            controller.RegisterView(viewMock);
            controller.Prepare();
            modelChangedRaiser.Raise(null, new ModelChangedArgs(EventReceiver.ProjectView, EventContext.ProjectsRequested));

            MockRepository.VerifyAll();
        }
        public void GetProjects()
        {
            var waitCursorStub = MockRepository.Stub <IWaitCursor>();

            Expect.Call(() => eventDispatcherMock.ModelChanged += null).IgnoreArguments();
            Expect.Call(viewMock.Controller).PropertyBehavior();
            Expect.Call(viewMock.UpdateData);
            Expect.Call(viewMock.GetWaitCursor()).Return(waitCursorStub);
            Expect.Call(dataLayerMock.GetProjectTree()).Return(null);
            Expect.Call(viewMock.Projects).PropertyBehavior();
            Expect.Call(viewMock.CompleteProjectsRequest);

            MockRepository.ReplayAll();

            controller = new TestProjectTreeController(loggerFactoryMock, dataLayerMock, settingsMock, eventDispatcherMock);
            controller.RegisterView(viewMock);
            controller.PrepareView();
            controller.Prepare();
            controller.HandleProjectsRequest();

            MockRepository.VerifyAll();
        }