public IntegrationTests() { _directoryPathProviderMock = Substitute.For <IDirectoryPathProvider>(); _newImageDataProviderMock = Substitute.For <INewImageDataProvider>(); _confirmationServiceMock = Substitute.For <IConfirmationService>(); _errorHandlerMock = Substitute.For <IErrorHandler>(); _errorHandlerMock.WhenForAnyArgs(x => x.ShowError(default)).Do(x => throw x.ArgAt <Exception>(0));
public ImageViewerViewModel( IGalleryManager unsamplesDirectoryOpener, IDirectoryPathProvider directoryPathProvider, IErrorHandler errorHandler, IConfirmationService confirmationService, INewImageDataProvider newImageDataProvider) { _galleryManager = unsamplesDirectoryOpener; _directoryPathProvider = directoryPathProvider; _errorHandler = errorHandler; _confirmationService = confirmationService; _newImageDataProvider = newImageDataProvider; }
public ImageViewerViewModelTests() { _galleryManager = Substitute.For <IGalleryManager>(); _directoryPathProviderMock = Substitute.For <IDirectoryPathProvider>(); _errorHandlerMock = Substitute.For <IErrorHandler>(); _confirmationServiceMock = Substitute.For <IConfirmationService>(); _newImageDataProvider = Substitute.For <INewImageDataProvider>(); _viewModel = Substitute.ForPartsOf <ImageViewerViewModel>( _galleryManager, _directoryPathProviderMock, _errorHandlerMock, _confirmationServiceMock, _newImageDataProvider); }
public GalleryImageSelectorTests() { _galleryManager = Substitute.For <IGalleryManager>(); _directoryPathProviderMock = Substitute.For <IDirectoryPathProvider>(); _errorHandlerMock = Substitute.For <IErrorHandler>(); _confirmationServiceMock = Substitute.For <IConfirmationService>(); _newImageDataProvider = Substitute.For <INewImageDataProvider>(); _viewModel = new ImageViewerViewModel( _galleryManager, _directoryPathProviderMock, _errorHandlerMock, _confirmationServiceMock, _newImageDataProvider); _testGallery = new ImageGallery("Test name", new List <GalleryImageInfo> { new GalleryImageInfo("fullname\\name.jpg", true, new CreditsEntry { PhotoUrl = "url", UserName = "******", UserUrl = "userurl", }), new GalleryImageInfo("fullname\\name1.jpg", true, new CreditsEntry { PhotoUrl = "url1", UserName = "******", UserUrl = "userurl1", }), new GalleryImageInfo("fullname\\name2.jpg", true, new CreditsEntry { PhotoUrl = "url2", UserName = "******", UserUrl = "userurl2", }), }); _galleryManager.OpenGallery(Arg.Any <string>()).Returns(_testGallery); _viewModel.OpenGallery(); }