private static void CreateFullExportsAndVm()
        {
            CreateEnvironmentModel();
            var securityContext = GetMockSecurityContext();
            var environmentRepo = GetEnvironmentRepository();
            var workspaceRepo   = GetworkspaceItemRespository();

            _eventAggregator           = new Mock <IEventAggregator>();
            _popupController           = new Mock <IPopupController>();
            _feedbackInvoker           = new Mock <IFeedbackInvoker>();
            _resourceDependencyService = new Mock <IResourceDependencyService>();
            _webController             = new Mock <IWebController>();
            _windowManager             = new Mock <IWindowManager>();
            _importServiceContext      =
                CompositionInitializer.InitializeMockedMainViewModel(securityContext: securityContext,
                                                                     environmentRepo: environmentRepo,
                                                                     workspaceItemRepository: workspaceRepo,
                                                                     aggregator: _eventAggregator,
                                                                     popupController: _popupController,
                                                                     resourceDepService: _resourceDependencyService,
                                                                     feedbackInvoker: _feedbackInvoker,
                                                                     webController: _webController,
                                                                     windowManager: _windowManager);

            ImportService.CurrentContext = _importServiceContext;
            try
            {
                _mainViewModel = new MainViewModel(environmentRepo, false);
            }
            catch (Exception e)
            {
            }
        }
Exemple #2
0
        public void EnvironmentTestsInitialize()
        {
            Monitor.Enter(DataListSingletonTestGuard);
            _aggregator = new Mock <IEventAggregator>();

            _aggregator.Setup(e => e.Publish(It.IsAny <object>())).Verifiable();
            _importServiceContext        = CompositionInitializer.InitializeMockedMainViewModel();
            ImportService.CurrentContext = _importServiceContext;

            SetupMocks();

            LayoutGrid = new LayoutGridViewModel(_aggregator.Object, _mockWebActivity.Object);

            //Mediator.DeRegisterAllActionsForMessage(MediatorMessages.RemoveUnusedDataListItems);
            //Mediator.DeRegisterAllActionsForMessage(MediatorMessages.AddMissingDataListItems);
            //Mediator.DeRegisterAllActionsForMessage(MediatorMessages.AddWorkflowDesigner);
        }
 public static void MyClassInitialize(TestContext testContext)
 {
     _importServiceContext = CompositionInitializer.InitializeMockedMainViewModel();
 }