Пример #1
0
        protected void Configure()
        {
            var mockEventAggregator = new MockEventAggregator();
            var mockSubsonicService = new MockSubsonicService();
            var mockNavigationService = new MockNavigationService();
            var mockNotificationService = new MockToastNotificationService();
            var mockDialogNotificationService = new MockDialogNotificationService();
            var mockStorageService = new MockStorageService();
            var mockWinRTWrappersService = new MockWinRTWrappersService();
            var shellViewModel = new ShellViewModel(mockEventAggregator, mockSubsonicService, mockNavigationService,
                mockNotificationService, mockDialogNotificationService, mockStorageService, mockWinRTWrappersService);

            IoC.GetInstance = (type, s) =>
                                  {
                                      object instance = null;
                                      if (type == typeof(IShellViewModel))
                                      {
                                          instance = shellViewModel;
                                      }
                                      else if (type == typeof(ISubsonicService))
                                      {
                                          instance = mockSubsonicService;
                                      }
                                      return instance;
                                  };
        }
 public void Setup()
 {
     _mockSubsonicService = new MockSubsonicService();
     _mockStorageService = new MockStorageService();
     _mockToastNotificationService = new MockToastNotificationService();
     _mockNavigationService = new MockNavigationService();
     _subject = new SettingsViewModel(_mockSubsonicService, _mockToastNotificationService, _mockStorageService, _mockNavigationService);
 }
Пример #3
0
 public void TestInitialize()
 {
     IoC.GetInstance = (type, s) => null;
     _mockSubsonicService = new MockSubsonicService();
     _mockNavigationService = new MockNavigationService();
     _mockToastNotificationService = new MockToastNotificationService();
     _mockDialogNotificationService = new MockDialogNotificationService();
     _mockStorageService = new MockStorageService();
     _mockWinRTWrappersService = new MockWinRTWrappersService();
     _mockPlayerControls = new MockPlayerControls();
     Subject = new ShellViewModel(_eventAggregator, _mockSubsonicService, _mockNavigationService,
         _mockToastNotificationService, _mockDialogNotificationService, _mockStorageService, _mockWinRTWrappersService)
         {
             PlayerControls = _mockPlayerControls
         };
 }
Пример #4
0
 public void TestInitialize()
 {
     IoC.GetInstance = (type, s) => null;
     _mockEventAggregator = new MockEventAggregator();
     _mockSubsonicService = new MockSubsonicService();
     _mockNavigationService = new MockNavigationService();
     _mockToastNotificationService = new MockToastNotificationService();
     _mockDialogNotificationService = new MockDialogNotificationService();
     _mockStorageService = new MockStorageService();
     _mockWinRTWrappersService = new MockWinRTWrappersService();
     _mockErrorDialogViewModel = new MockErrorDialogViewModel();
     Subject = new ShellViewModel
                   {
                       EventAggregator = _mockEventAggregator,
                       SubsonicService = _mockSubsonicService,
                       NavigationService = _mockNavigationService,
                       NotificationService = _mockToastNotificationService,
                       DialogNotificationService = _mockDialogNotificationService,
                       StorageService = _mockStorageService,
                       WinRTWrappersService = _mockWinRTWrappersService,
                       ErrorDialogViewModel = _mockErrorDialogViewModel
                   };
 }