예제 #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");
 }
예제 #2
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     //   _startingDir = @"c:\git\Duplicates\TestData";
     var _fileListBuilder = new ListBuilderService(new MD5HashCalculator(), new UIThreadMarshaller(SynchronizationContext.Current));
 }
예제 #3
0
파일: Form1.cs 프로젝트: avylov/duplicates
        private void Initialize()
        {
            var uiThreadMarshaller = new UIThreadMarshaller(SynchronizationContext.Current);
            var hashCalculator = radioButtonMd5.Checked
                                     ? (IChecksumCalculator) new MD5HashCalculator()
                                     : new Sha256HashCalculator();

            _listBuilderServiceService = new ListBuilderService(hashCalculator, uiThreadMarshaller);
            var mainThreadInvoker = new MainThreadInvoker(SynchronizationContext.Current);
            new FileListBuilderPresenter(this, _listBuilderServiceService, new FileRetrieverServiceService(mainThreadInvoker, new FileInfoImplemantation()),uiThreadMarshaller);
            _initialPathSelectrorPresenter = new InitialPathSelectrorPresenter(this);
        }