예제 #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 TestInitialize()
 {
     IoC.GetInstance = (type, s) => null;
     _eventAggregator = new MockEventAggregator();
     _navigationService = new MockNavigationService();
     _subject = new DefaultBottomBarViewModel(_navigationService, _eventAggregator) { Navigate = _navigationService.DoNavigate };
 }
 public void Setup()
 {
     IoC.GetInstance = (type, s) => null;
     _mockPlayerControls = new MockExtendedPlayerControls();
     _mockEventAggregator = new MockEventAggregator();
     _subject = new AudioPlayerViewModel
                    {
                        EventAggregator = _mockEventAggregator,
                        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
                   };
 }