public void Setup() { _mockView = MockRepository.GenerateStub<IFileBuilderView>(); MockBuilderService = MockRepository.GenerateStub<IListBuilderService>(); MockRetrieverService = MockRepository.GenerateStub<IFileRetrieverService>(); _listOfSelectedItemsToRemove = new List<string>() { "one", "two", "three" }; new FileListBuilderPresenter(_mockView, MockBuilderService, MockRetrieverService, null); _mockView.Raise(view => view.OnSelectItemsToDelete += null, null, new StringListEventArgs(_listOfSelectedItemsToRemove)); }
public FileListBuilderPresenterFixtureBase() { _mockView = MockRepository.GenerateStub<IFileBuilderView>(); MockBuilderService = MockRepository.GenerateStub<IListBuilderService>(); MockRetrieverService = MockRepository.GenerateStub<IFileRetrieverService>(); _listOfDuplicateFiles = new List<string> { "one", "two", "three" }; _dict = new Dictionary<string, long> { { "one", 1 }, { "two", 2 }, { "three", 3 } }; _dictionaryOfAllDuplicates = new Dictionary<string, IList<string>> { { "one", new List<string> { "two", "three" } } }; MockBuilderService.Stub((listBuilder => listBuilder.GetDuplicateFiles())).Return(_listOfDuplicateFiles); MockBuilderService.Stub(fileListBuilder => fileListBuilder.GetDuplicates()).Return(_dictionaryOfAllDuplicates); MockRetrieverService.Stub(retriever => retriever.GetFileInformation(_listOfDuplicateFiles)).Return(_dict); MockRetrieverService.Stub(fileRetriever => fileRetriever.GetFileNames(Arg<string>.Is.Anything)).Return( _listOfDuplicateFiles); new FileListBuilderPresenter(_mockView, MockBuilderService, MockRetrieverService, null); }
public FileListBuilderPresenter(IFileBuilderView fileBuilderView, IListBuilderService listBuilderService, IFileRetrieverService fileRetrieverService, IUIThreadMarshaller uiThreadMarshaller) { _fileBuilderView = fileBuilderView; _fileRetrieverService = fileRetrieverService; _uiThreadMarshaller = uiThreadMarshaller; _listBuilderService = listBuilderService; _fileRetrieverService.FileProcessingProgress += ProcessingProgress; _listBuilderService.FileProcessingProgress += ProcessingProgress; _listBuilderService.ProcessingCompleted += ProcessingCompleted; _fileBuilderView.OnFindDuplicatesClick += OnFindDuplicatesClick; _fileBuilderView.OnDeleteClick += OnDeleteClick; _fileBuilderView.OnSelectItemsToDelete += OnSelectItemsToDelete; _fileBuilderView.OnCancelProcessing += OnCancelProcessing; }
public ViewModel(IListBuilderService listBuilderService, IUIThreadMarshaller uiThreadMarshaller, IFileRetrieverService fileRetrieverService) { var fileListBuilderPresenter = new FileListBuilderPresenter(this, listBuilderService, fileRetrieverService, uiThreadMarshaller); }
public Model(string path, IListBuilderService listBuilderService, IFileRetrieverService fileRetrieverService) { _path = path; _listBuilderService = listBuilderService; _fileRetrieverService = fileRetrieverService; }