Ejemplo n.º 1
0
 public void Setup()
 {
     _fileName = "someFile";
     _stubChecksumCalculator = MockRepository.GenerateStub<IChecksumCalculator>();
     _stubUIThreadMarshaller = MockRepository.GenerateStub<IUIThreadMarshaller>();
     _listBuilderServiceService = new ListBuilderService(_stubChecksumCalculator, _stubUIThreadMarshaller);
     _stubChecksumCalculator.Stub(sumCalculator => sumCalculator.GetHashFromFile(_fileName)).IgnoreArguments().Return("someHash");
 }
Ejemplo n.º 2
0
 public ListBuilderService(IChecksumCalculator checksumCalculator, IUIThreadMarshaller uiThreadMarshaller)
 {
     _hashList = new Dictionary<string, string>();
     _duplicateFilesList = new Dictionary<string, string>();
     _duplicatedFileNamesDictionary = new Dictionary<string, IList<string>>();
     _latestProcessedFiles = new Dictionary<string, IList<string>>();
     _checksumCalculator = checksumCalculator;
     _uiThreadMarshaller = uiThreadMarshaller;
 }
Ejemplo n.º 3
0
        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;
        }
Ejemplo n.º 4
0
 public ViewModel(IListBuilderService listBuilderService, IUIThreadMarshaller uiThreadMarshaller, IFileRetrieverService fileRetrieverService)
 {
     var fileListBuilderPresenter = new FileListBuilderPresenter(this, listBuilderService, fileRetrieverService, uiThreadMarshaller);
 }