コード例 #1
0
 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));
 }
コード例 #2
0
 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);
 }
コード例 #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;
        }
コード例 #4
0
ファイル: ViewModel.cs プロジェクト: avylov/duplicates
 public ViewModel(IListBuilderService listBuilderService, IUIThreadMarshaller uiThreadMarshaller, IFileRetrieverService fileRetrieverService)
 {
     var fileListBuilderPresenter = new FileListBuilderPresenter(this, listBuilderService, fileRetrieverService, uiThreadMarshaller);
 }
コード例 #5
0
ファイル: Model.cs プロジェクト: avylov/duplicates
 public Model(string path, IListBuilderService listBuilderService, IFileRetrieverService fileRetrieverService)
 {
     _path = path;
     _listBuilderService = listBuilderService;
     _fileRetrieverService = fileRetrieverService;
 }