static ExchangeNewEmailDesignerViewModel CreateNewViewModel(IShellViewModel shellViewModel, ModelItem modelItem, IExchangeServiceModel model, IEventAggregator eve) { var mockActiveDataList = SetupActiveDataList(); var mockServer = new Mock <IServer>(); var mockStudioUpdateManager = new Mock <IStudioUpdateManager>(); mockServer.SetupGet(it => it.UpdateRepository).Returns(mockStudioUpdateManager.Object); var mockQueryManager = new Mock <IQueryManager>(); var mockExchangeServiceModel = new Mock <IExchangeServiceModel>(); mockExchangeServiceModel.Setup(a => a.RetrieveSources()).Returns(new ObservableCollection <IExchangeSource> { new ExchangeSourceDefinition { Id = Guid.NewGuid() } }); mockQueryManager.Setup(query => query.FetchExchangeSources()).Returns(new ObservableCollection <IExchangeSource> { new ExchangeSourceDefinition { Id = Guid.NewGuid() } }); mockServer.SetupGet(it => it.QueryProxy).Returns(mockQueryManager.Object); ServerRepository.Instance.ActiveServer = mockServer.Object; var testEmailDesignerViewModel = new ExchangeNewEmailDesignerViewModel(modelItem, new AsyncWorker(), mockServer.Object, eve, shellViewModel, mockActiveDataList.Object); testEmailDesignerViewModel.SourceRegion.SelectedSource = model.RetrieveSources().First(); return(testEmailDesignerViewModel); }
static ExchangeNewEmailDesignerViewModel CreateViewModel(IShellViewModel shellViewModel, ModelItem modelItem, IExchangeServiceModel model, IEventAggregator eve) { var mockActiveDataList = SetupActiveDataList(); var testEmailDesignerViewModel = new ExchangeNewEmailDesignerViewModel(modelItem, new AsyncWorker(), model, eve, shellViewModel, mockActiveDataList.Object); testEmailDesignerViewModel.SourceRegion.SelectedSource = model.RetrieveSources().First(); return(testEmailDesignerViewModel); }