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 }; }
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 mockErrorDialogViewModel = new MockErrorDialogViewModel(); var shellViewModel = new ShellViewModel { EventAggregator = mockEventAggregator, SubsonicService = mockSubsonicService, NavigationService = mockNavigationService, NotificationService = mockNotificationService, DialogNotificationService = mockDialogNotificationService, StorageService = mockStorageService, WinRTWrappersService = mockWinRTWrappersService, ErrorDialogViewModel = mockErrorDialogViewModel }; IoC.GetInstance = (type, s) => { object instance = null; if (type == typeof(IShellViewModel)) { instance = shellViewModel; } else if (type == typeof(ISubsonicService)) { instance = mockSubsonicService; } return instance; }; }