Beispiel #1
0
        protected override void Context()
        {
            _view                       = A.Fake <IJournalView>();
            _regionResolver             = A.Fake <IRegionResolver>();
            _mapper                     = A.Fake <IJournalPageToJournalPageDTOMapper>();
            _journalTask                = A.Fake <IJournalTask>();
            _viewItemContextMenuFactory = A.Fake <IViewItemContextMenuFactory>();
            _journalRetriever           = A.Fake <IJournalRetriever>();
            _previewPresenter           = A.Fake <IJournalPagePreviewPresenter>();
            _journalExportTask          = A.Fake <IJournalExportTask>();
            _searchPresenter            = A.Fake <IJournalSearchPresenter>();
            _journalSearch              = new JournalSearch();
            A.CallTo(() => _view.BindTo(A <IEnumerable <JournalPageDTO> > ._))
            .Invokes(x => _allWorkingJournalItemDTOs = x.GetArgument <IEnumerable <JournalPageDTO> >(0).DowncastTo <IList <JournalPageDTO> >());

            _region = A.Fake <IRegion>();
            A.CallTo(_regionResolver).WithReturnType <IRegion>().Returns(_region);

            sut = new JournalPresenterForSpecs(_view, _regionResolver, _mapper, _journalTask, _viewItemContextMenuFactory,
                                               _journalRetriever, _previewPresenter, _searchPresenter);

            _journal = new Journal();
            A.CallTo(() => _journalRetriever.Current).Returns(_journal);

            _journalPage    = new JournalPage();
            _journalPageDTO = new JournalPageDTO(_journalPage);
            A.CallTo(_mapper).WithReturnType <JournalPageDTO>().Returns(_journalPageDTO);
        }
 public ProjectTask(IWorkspace workspace,
                    IApplicationController applicationController,
                    IDialogCreator dialogCreator,
                    IExecutionContext executionContext,
                    IHeavyWorkManager heavyWorkManager,
                    IWorkspaceLayoutUpdater workspaceLayoutUpdater,
                    IUserSettings userSettings,
                    IJournalTask journalTask,
                    IJournalRetriever journalRetriever,
                    ISnapshotTask snapshotTask,
                    IBuildingBlockInProjectManager buildingBlockInProjectManager
                    )
 {
     _workspace                     = workspace;
     _applicationController         = applicationController;
     _dialogCreator                 = dialogCreator;
     _executionContext              = executionContext;
     _heavyWorkManager              = heavyWorkManager;
     _workspaceLayoutUpdater        = workspaceLayoutUpdater;
     _userSettings                  = userSettings;
     _journalTask                   = journalTask;
     _journalRetriever              = journalRetriever;
     _snapshotTask                  = snapshotTask;
     _buildingBlockInProjectManager = buildingBlockInProjectManager;
 }
Beispiel #3
0
 protected JournalPresenter(
     IJournalView view,
     IRegionResolver regionResolver,
     IJournalPageToJournalPageDTOMapper mapper,
     IJournalTask journalTask,
     IViewItemContextMenuFactory viewItemContextMenuFactory,
     IJournalRetriever journalRetriever,
     IJournalPagePreviewPresenter previewPresenter,
     IJournalSearchPresenter searchPresenter, RegionName regionName)
     : base(view)
 {
     _mapper      = mapper;
     _journalTask = journalTask;
     _viewItemContextMenuFactory = viewItemContextMenuFactory;
     _journalRetriever           = journalRetriever;
     _previewPresenter           = previewPresenter;
     _searchPresenter            = searchPresenter;
     _region             = regionResolver.RegionWithName(regionName);
     _allJournalPageDTOs = new NotifyList <JournalPageDTO>();
     View.AddPreviewView(_previewPresenter.BaseView);
     View.AddSeachView(_searchPresenter.BaseView);
     AddSubPresenters(_previewPresenter, _searchPresenter);
     View.BindTo(_allJournalPageDTOs);
     View.SearchVisible = false;
     _journalSearch     = null;
     _region.Add(View);
 }
Beispiel #4
0
        public override Task GlobalContext()
        {
            _project                          = new PKSimProject();
            _dialogCreator                    = A.Fake <IDialogCreator>();
            _workspace                        = A.Fake <IWorkspace>();
            _executionContext                 = A.Fake <IExecutionContext>();
            _applicationController            = A.Fake <IApplicationController>();
            _workspaceLayoutUpdater           = A.Fake <IWorkspaceLayoutUpdater>();
            _userSettings                     = A.Fake <IUserSettings>();
            _journalTask                      = A.Fake <IJournalTask>();
            _journalRetriever                 = A.Fake <IJournalRetriever>();
            _snapshotTask                     = A.Fake <ISnapshotTask>();
            _buildingBlockInSimulationManager = A.Fake <IBuildingBlockInSimulationManager>();
            _workspace.Project                = _project;
            _workspace.WorkspaceLayout        = new WorkspaceLayout();
            _heavyWorkManager                 = new HeavyWorkManagerForSpecs();

            _simulation = new IndividualSimulation();

            _project.AddBuildingBlock(_simulation);

            sut = new ProjectTask(_workspace, _applicationController, _dialogCreator,
                                  _executionContext, _heavyWorkManager, _workspaceLayoutUpdater, _userSettings,
                                  _journalTask, _journalRetriever, _snapshotTask, _buildingBlockInSimulationManager);

            _oldFileExitst = FileHelper.FileExists;

            return(_completed);
        }
Beispiel #5
0
 public PKSimExportTask(IPKSimStarter pkSimStarter, ISimulationPersistor simulationPersister, IFavoriteRepository favoriteRepository, IJournalRetriever journalRetriever)
 {
     _pkSimStarter        = pkSimStarter;
     _simulationPersister = simulationPersister;
     _favoriteRepository  = favoriteRepository;
     _journalRetriever    = journalRetriever;
 }
Beispiel #6
0
 public JournalPresenter(IJournalView view, IRegionResolver regionResolver, IJournalPageToJournalPageDTOMapper mapper,
                         IJournalTask journalTask, IViewItemContextMenuFactory viewItemContextMenuFactory,
                         IJournalRetriever journalRetriever, IJournalPagePreviewPresenter previewPresenter,
                         IJournalSearchPresenter searchPresenter) :
     base(view, regionResolver, mapper, journalTask, viewItemContextMenuFactory, journalRetriever,
          previewPresenter, searchPresenter, RegionNames.Journal)
 {
 }
Beispiel #7
0
 public JournalSearchTask(IDatabaseMediator databaseMediator, IJournalRetriever journalRetriever,
                          IEventPublisher eventPublisher, IJournalSearchContextFinder searchContextFinder)
 {
     _databaseMediator    = databaseMediator;
     _journalRetriever    = journalRetriever;
     _eventPublisher      = eventPublisher;
     _searchContextFinder = searchContextFinder;
 }
Beispiel #8
0
        protected override void Context()
        {
            _pkSimStarter        = A.Fake <IPKSimStarter>();
            _simulationPersister = A.Fake <ISimulationPersistor>();
            _favoriteRepository  = A.Fake <IFavoriteRepository>();
            _journalRetriever    = A.Fake <IJournalRetriever>();
            A.CallTo(() => _journalRetriever.JournalFullPath).Returns("JournalFullPath");

            sut = new PKSimExportTask(_pkSimStarter, _simulationPersister, _favoriteRepository, _journalRetriever);
        }
Beispiel #9
0
 protected override void Context()
 {
     _view            = A.Fake <IRelatedItemsView>();
     _dialogCreator   = A.Fake <IDialogCreator>();
     _journalPageTask = A.Fake <IJournalPageTask>();
     _relatedItemComparablePresenter = A.Fake <IRelatedItemComparablePresenter>();
     _reloadRelatedItemTask          = A.Fake <IReloadRelatedItemTask>();
     _journalRetriever = A.Fake <IJournalRetriever>();
     sut          = new RelatedItemsPresenter(_view, _journalRetriever, _journalPageTask, _relatedItemComparablePresenter, _reloadRelatedItemTask);
     _journalPage = new JournalPage();
 }
Beispiel #10
0
        protected override void Context()
        {
            _databaseMediator    = A.Fake <IDatabaseMediator>();
            _journalRetriever    = A.Fake <IJournalRetriever>();
            _eventPublisher      = A.Fake <IEventPublisher>();
            _searchContextFinder = A.Fake <IJournalSearchContextFinder>();
            sut = new JournalSearchTask(_databaseMediator, _journalRetriever, _eventPublisher, _searchContextFinder);

            _journalSearch = new JournalSearch();
            _journalIds    = new List <string>();
        }
        public JournalTestPresenter(IJournalTestView view, IJournalDiagramPresenter journalDiagramPresenter, IJournalTask journalTask, IJournalExportTask journalExportTask, IJournalRetriever journalRetriever, IJournalPresenter journalPresenter, IJournalPageEditorFormPresenter journalPageEditorFormPresenter, IJournalRichEditFormPresenter journalRichEditFormPresenter) : base(view)
        {
            _view.AddDiagram(journalDiagramPresenter.View);

            _journalTask                    = journalTask;
            _journalExportTask              = journalExportTask;
            _journalRetriever               = journalRetriever;
            _journalPresenter               = journalPresenter;
            _journalDiagramPresenter        = journalDiagramPresenter;
            _journalPageEditorFormPresenter = journalPageEditorFormPresenter;
            _journalRichEditFormPresenter   = journalRichEditFormPresenter;
        }
Beispiel #12
0
 public JournalTask(IJournalPageFactory journalPageFactory,
                    IDatabaseMediator databaseMediator, IJournalRetriever journalRetriever,
                    IEventPublisher eventPublisher, IJournalSessionConnector journalSessionConnector,
                    IRelatedItemFactory relatedItemFactory, IJournalPageTask journalPageTask, IDialogCreator dialogCreator)
 {
     _journalPageFactory      = journalPageFactory;
     _databaseMediator        = databaseMediator;
     _journalRetriever        = journalRetriever;
     _eventPublisher          = eventPublisher;
     _journalSessionConnector = journalSessionConnector;
     _relatedItemFactory      = relatedItemFactory;
     _journalPageTask         = journalPageTask;
     _dialogCreator           = dialogCreator;
 }
Beispiel #13
0
 public RelatedItemsPresenter(
     IRelatedItemsView view,
     IJournalRetriever journalRetriever,
     IJournalPageTask journalPageTask,
     IRelatedItemComparablePresenter relatedItemComparablePresenter,
     IReloadRelatedItemTask reloadRelatedItemTask) : base(view)
 {
     _journalRetriever = journalRetriever;
     _journalPageTask  = journalPageTask;
     _relatedItemComparablePresenter = relatedItemComparablePresenter;
     _reloadRelatedItemTask          = reloadRelatedItemTask;
     _view.AddComparableView(_relatedItemComparablePresenter.View);
     AddSubPresenters(_relatedItemComparablePresenter);
 }
        protected override void Context()
        {
            _eventPublisher     = A.Fake <IEventPublisher>();
            _databaseMediator   = A.Fake <IDatabaseMediator>();
            _dialogCreator      = A.Fake <IDialogCreator>();
            _journalRetriever   = A.Fake <IJournalRetriever>();
            _relatedItemFactory = A.Fake <IRelatedItemFactory>();
            _journal            = new Core.Journal.Journal();

            A.CallTo(() => _journalRetriever.Current).Returns(_journal);

            sut = new JournalPageTask(_databaseMediator, _eventPublisher, _dialogCreator, _relatedItemFactory);

            _journalPage = new JournalPage();
            _journal.AddJournalPage(_journalPage);
        }
Beispiel #15
0
 public MoBiExportTask(IBuildConfigurationTask buildConfigurationTask, ISimulationToModelCoreSimulationMapper simulationMapper,
                       IRepresentationInfoRepository representationInfoRepository, IPKSimConfiguration configuration,
                       ILazyLoadTask lazyLoadTask, IDialogCreator dialogCreator, ISimulationPersistor simulationPersistor, IProjectRetriever projectRetriever,
                       IObjectIdResetter objectIdResetter, IJournalRetriever journalRetriever)
 {
     _buildConfigurationTask       = buildConfigurationTask;
     _simulationMapper             = simulationMapper;
     _representationInfoRepository = representationInfoRepository;
     _configuration       = configuration;
     _lazyLoadTask        = lazyLoadTask;
     _dialogCreator       = dialogCreator;
     _simulationPersistor = simulationPersistor;
     _projectRetriever    = projectRetriever;
     _objectIdResetter    = objectIdResetter;
     _journalRetriever    = journalRetriever;
 }
Beispiel #16
0
        protected override void Context()
        {
            _buildConfigurationTask       = A.Fake <IBuildConfigurationTask>();
            _simulationMapper             = A.Fake <ISimulationToModelCoreSimulationMapper>();
            _representationInfoRepository = A.Fake <IRepresentationInfoRepository>();
            _configuration       = A.Fake <IPKSimConfiguration>();
            _lazyLoadTask        = A.Fake <ILazyLoadTask>();
            _dialogCreator       = A.Fake <IDialogCreator>();
            _simulationPersistor = A.Fake <ISimulationPersistor>();
            _projectRetriever    = A.Fake <IProjectRetriever>();
            _objectIdResetter    = A.Fake <IObjectIdResetter>();
            _journalRetriever    = A.Fake <IJournalRetriever>();

            sut = new MoBiExportTask(_buildConfigurationTask, _simulationMapper, _representationInfoRepository,
                                     _configuration, _lazyLoadTask, _dialogCreator, _simulationPersistor, _projectRetriever, _objectIdResetter, _journalRetriever);
        }
Beispiel #17
0
 public JournalPageEditorPresenter(
     IJournalPageEditorView view,
     IContentLoader contentLoader,
     IJournalPageToJournalPageDTOMapper mapper,
     IJournalTask journalTask,
     IJournalRetriever journalRetriever,
     IPresentationUserSettings userSettings
     )
     : base(view)
 {
     _contentLoader       = contentLoader;
     _mapper              = mapper;
     _journalTask         = journalTask;
     _journalRetriever    = journalRetriever;
     _journalPageSettings = userSettings.JournalPageEditorSettings;
     _view.ApplyUserSettingsToRichEdit(_journalPageSettings);
 }
Beispiel #18
0
 public override void GlobalContext()
 {
     base.GlobalContext();
     _project                   = A.Fake <IPKSimProject>();
     _dialogCreator             = A.Fake <IDialogCreator>();
     _workspace                 = A.Fake <IWorkspace>();
     _executionContext          = A.Fake <IExecutionContext>();
     _applicationController     = A.Fake <IApplicationController>();
     _workspaceLayoutUpdater    = A.Fake <IWorkspaceLayoutUpdater>();
     _userSettings              = A.Fake <IUserSettings>();
     _journalTask               = A.Fake <IJournalTask>();
     _journalRetriever          = A.Fake <IJournalRetriever>();
     _workspace.Project         = _project;
     _workspace.WorkspaceLayout = new WorkspaceLayout();
     _heavyWorkManager          = new HeavyWorkManagerForSpecs();
     sut = new ProjectTask(_workspace, _applicationController, _dialogCreator,
                           _executionContext, _heavyWorkManager, _workspaceLayoutUpdater, _userSettings, _journalTask, _journalRetriever);
     _oldFileExitst = FileHelper.FileExists;
 }
Beispiel #19
0
        protected override void Context()
        {
            _view             = A.Fake <IJournalPageEditorView>();
            _contentLoader    = A.Fake <IContentLoader>();
            _eventPublisher   = A.Fake <IEventPublisher>();
            _journalTask      = A.Fake <IJournalTask>();
            _mapper           = A.Fake <IJournalPageToJournalPageDTOMapper>();
            _journalSearch    = new JournalSearch();
            _userSettings     = A.Fake <IPresentationUserSettings>();
            _journalRetriever = A.Fake <IJournalRetriever>();
            sut = new JournalPageEditorPresenter(_view, _contentLoader, _mapper, _journalTask, _journalRetriever, _userSettings);

            _journalPage    = new JournalPage();
            _journalPageDTO = new JournalPageDTO(_journalPage);

            _journal = new Journal();
            _journal.AddJournalPage(_journalPage);
            A.CallTo(() => _journalRetriever.Current).Returns(_journal);
            A.CallTo(_mapper).WithReturnType <JournalPageDTO>().Returns(_journalPageDTO);
        }
Beispiel #20
0
        protected override void Context()
        {
            _journalPageFactory      = A.Fake <IJournalPageFactory>();
            _databaseMediator        = A.Fake <IDatabaseMediator>();
            _journalRetriever        = A.Fake <IJournalRetriever>();
            _eventPublisher          = A.Fake <IEventPublisher>();
            _journalSessionConnector = A.Fake <IJournalSessionConnector>();
            _relatedItemFactory      = A.Fake <IRelatedItemFactory>();
            _journalPageTask         = A.Fake <IJournalPageTask>();

            _dialogCreator = A.Fake <IDialogCreator>();
            sut            = new JournalTask(_journalPageFactory,
                                             _databaseMediator, _journalRetriever, _eventPublisher, _journalSessionConnector, _relatedItemFactory, _journalPageTask, _dialogCreator);


            _journal = new Core.Journal.Journal();
            _journalRetriever.Current = _journal;

            _journalPage = new JournalPage();
        }
Beispiel #21
0
 public JournalPresenterForSpecs(IJournalView view, IRegionResolver regionResolver, IJournalPageToJournalPageDTOMapper mapper,
                                 IJournalTask journalTask, IViewItemContextMenuFactory viewItemContextMenuFactory, IJournalRetriever journalRetriever,
                                 IJournalPagePreviewPresenter previewPresenter, IJournalSearchPresenter searchPresenter) :
     base(view, regionResolver, mapper, journalTask, viewItemContextMenuFactory, journalRetriever,
          previewPresenter, searchPresenter, new RegionName("XX", "XX", ApplicationIcons.EmptyIcon))
 {
 }