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"); }
protected void Button1_Click(object sender, EventArgs e) { // _startingDir = @"c:\git\Duplicates\TestData"; var _fileListBuilder = new ListBuilderService(new MD5HashCalculator(), new UIThreadMarshaller(SynchronizationContext.Current)); }
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); }