Пример #1
0
        public ViewModelService InitializeViewModelService(
            IAboutPanelService aboutPanelService             = null,
            IDialoguePageCommands dialoguePageCommands       = null,
            IDocumentMetadataManager documentMetadataManager = null,
            IOptionsLists optionsLists = null,
            IOptionsPageControlFactory optionsPageControlFactory = null,
            ISolutionEventsService solutionEventsService         = null,
            IToolWindowCommands toolWindowCommands = null,
            IUserPreferences userPreferences       = null,
            IUserPreferencesModelFactory userPreferencesModelFactory       = null,
            IUserPreferencesModelRepository userPreferencesModelRepository = null)
        {
            var repository = new MockRepository(MockBehavior.Loose)
            {
                DefaultValue = DefaultValue.Mock
            };

            var service = new ViewModelService(
                aboutPanelService ?? Mock.Of <IAboutPanelService>(),
                dialoguePageCommands ?? Mock.Of <IDialoguePageCommands>(),
                documentMetadataManager ?? Mock.Of <IDocumentMetadataManager>(),
                optionsLists ?? repository.OneOf <IOptionsLists>(),
                optionsPageControlFactory ?? repository.OneOf <IOptionsPageControlFactory>(),
                solutionEventsService ?? Mock.Of <ISolutionEventsService>(),
                toolWindowCommands ?? Mock.Of <IToolWindowCommands>(),
                userPreferences ?? Mock.Of <IUserPreferences>(),
                userPreferencesModelFactory ?? Mock.Of <IUserPreferencesModelFactory>(),
                userPreferencesModelRepository ?? Mock.Of <IUserPreferencesModelRepository>());

            return(service);
        }
Пример #2
0
 public ViewModelService(
     IAboutPanelService aboutPanelService,
     IDialoguePageCommands dialoguePageCommands,
     IDocumentMetadataManager documentMetadataManager,
     IOptionsLists optionsLists,
     IOptionsPageControlFactory optionsPageControlFactory,
     ISolutionEventsService solutionEventsService,
     IToolWindowCommands toolWindowCommands,
     IUserPreferences userPreferences,
     IUserPreferencesModelFactory userPreferencesModelFactory,
     IUserPreferencesModelRepository userPreferencesModelRepository)
 {
     AboutPanelService              = aboutPanelService;
     DialoguePageCommands           = dialoguePageCommands;
     DocumentMetadataManager        = documentMetadataManager;
     OptionsLists                   = optionsLists;
     OptionsPageControlFactory      = optionsPageControlFactory;
     SolutionEventsService          = solutionEventsService;
     ToolWindowCommands             = toolWindowCommands;
     UserPreferences                = userPreferences;
     UserPreferencesModelFactory    = userPreferencesModelFactory;
     UserPreferencesModelRepository = userPreferencesModelRepository;
 }