Esempio n. 1
0
        public void TestDownloadFile()
        {
            TestView test_view = new TestView();
            TestModel test_model = new TestModel();
            IPresenter presenter = new GuiPresenter(test_view, test_model);

            presenter.Connect();

            var test_file_path = new List<string> { "str1", "str2", "some file" };
            presenter.NodeSelected(test_file_path);
            presenter.LoadAction();

            Assert.AreEqual(test_file_path, test_model.hierarchy);
        }
Esempio n. 2
0
        public void TestPresenterUpload()
        {
            TestView test_view = new TestView();
            TestModel test_model = new TestModel();
            IPresenter presenter = new GuiPresenter(test_view, test_model);

            presenter.NodeSelected(new List<string>{"1.1"});
            presenter.LoadAction();
            Assert.IsTrue(test_model.uploaded);

            test_model.uploaded = false;
            presenter.NodeSelected(new List<string>{"2.1"});
            presenter.LoadAction();
            Assert.IsFalse(test_model.uploaded);
        }