public void PopulateAndSwapListViewsWhenDirectorySelectedEventFired()
        {
            _presenter = new Presenter(_view);
            _viewAsStub.FireBrowserViewLoadEvent();

            _viewAsStub.DirSelected = new DirectoryInfo(TargetDirectory.FullName);
            _viewAsStub.FireDirectorySelectedEvent();
        }
        public void InitDirectoryDuringViewLoad()
        {
            var presenter = new Presenter(_view);

            Assert.IsFalse(_dirTreeAsStub.InitDrives_Called);
            _viewAsStub.FireBrowserViewLoadEvent();
            Assert.IsTrue(_dirTreeAsStub.InitDrives_Called);
        }
        public void PresenterRegistersAsListenerForLoadEvent()
        {
            Assert.AreEqual(0, _viewAsStub.ImageBrowserViewLoadListenerCount);
            var presenter = new Presenter(_view);

            const int expectedListenersCount = 1;
            var actualListenersCount = _viewAsStub.ImageBrowserViewLoadListenerCount;
            Assert.AreEqual(expectedListenersCount, actualListenersCount);
        }
        public void PresenterRegistersAsListenerForDirectorySelectedEvent()
        {
            Assert.AreEqual(0, _viewAsStub.DirectorySelectedListenerCount);
            var presenter = new Presenter(_view);

            const int expectedListenersCount = 1;
            var actualListenersCount = _viewAsStub.DirectorySelectedListenerCount;
            Assert.AreEqual(expectedListenersCount, actualListenersCount);
        }
Beispiel #5
0
 public Form2()
 {
     InitializeComponent();
     _presenter = new ImageBrowserPresenter.Presenter(this);
     _listViewParentContainer = listView1.Parent;
 }
Beispiel #6
0
 public Form2()
 {
     InitializeComponent();
     _presenter = new ImageBrowserPresenter.Presenter(this);
     _listViewParentContainer = listView1.Parent;
 }
        public void UpdateStatusAfterDirectorySelected()
        {
            _presenter = new Presenter(_view);

            Assert.IsTrue(string.IsNullOrEmpty(_viewAsStub.UpdateAppStatus_Message));
            Assert.IsTrue(string.IsNullOrEmpty(_viewAsStub.UpdateDirStatus_Message));
            Assert.IsTrue(string.IsNullOrEmpty(_viewAsStub.UpdateFilesStatus_Message));

            _viewAsStub.FireBrowserViewLoadEvent();

            Assert.IsTrue(string.IsNullOrEmpty(_viewAsStub.UpdateAppStatus_Message));
            Assert.IsTrue(string.IsNullOrEmpty(_viewAsStub.UpdateDirStatus_Message));
            Assert.IsTrue(string.IsNullOrEmpty(_viewAsStub.UpdateFilesStatus_Message));

            _viewAsStub.DirSelected = new DirectoryInfo(TargetDirectory.FullName);
            _viewAsStub.FireDirectorySelectedEvent();

            Assert.IsFalse(string.IsNullOrEmpty(_viewAsStub.UpdateAppStatus_Message));
            Assert.IsFalse(string.IsNullOrEmpty(_viewAsStub.UpdateDirStatus_Message));
            Assert.IsFalse(string.IsNullOrEmpty(_viewAsStub.UpdateFilesStatus_Message));
        }
        public void UpdateStatusOnTimer()
        {
            _presenter = new Presenter(_view);

            Assert.IsTrue(string.IsNullOrEmpty(_viewAsStub.UpdateAppStatus_Message));
            Assert.IsTrue(string.IsNullOrEmpty(_viewAsStub.UpdateDirStatus_Message));
            Assert.IsTrue(string.IsNullOrEmpty(_viewAsStub.UpdateFilesStatus_Message));

            _viewAsStub.FireBrowserViewLoadEvent();

            Assert.IsTrue(string.IsNullOrEmpty(_viewAsStub.UpdateAppStatus_Message));
            Assert.IsTrue(string.IsNullOrEmpty(_viewAsStub.UpdateDirStatus_Message));
            Assert.IsTrue(string.IsNullOrEmpty(_viewAsStub.UpdateFilesStatus_Message));

            Thread.Sleep(_presenter.StatusPollingIntervalMsec *2);

            Assert.IsFalse(string.IsNullOrEmpty(_viewAsStub.UpdateAppStatus_Message));

            //still no directory or files set
            Assert.IsTrue(string.IsNullOrEmpty(_viewAsStub.UpdateDirStatus_Message));
            Assert.IsTrue(string.IsNullOrEmpty(_viewAsStub.UpdateFilesStatus_Message));
        }