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");
 }
Example #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));
 }
Example #3
0
        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);
        }