Пример #1
0
        private void buildProject_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult writethrough =MessageBoxResult.Yes;
            if(!pathProject.Contains(title)){
                 pathProject = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) +"\\" +title+ ".oqatPrj";
            }

            if (!pathProject.EndsWith(".oqatPrj"))
            {
                pathProject = pathProject+".oqatPrj";
            }

            if (File.Exists(pathProject))
            {
                writethrough = MessageBox.Show(msgboxovverid,
            msgboxoverrid2, MessageBoxButton.YesNo);
            }

            if (writethrough == MessageBoxResult.Yes)
            {
                project = new Project(tbTitel.Text, pathProject, description);
                this.DialogResult = true;
            }
        }
Пример #2
0
 public ProjectEventArgs(Project project)
 {
     this.project = project;
 }
Пример #3
0
 public void rmNodeTest()
 {
     Project test = new Project("myProject", "test/testing/myproject.oqatProj", "testprojekt zum testen");
 }
Пример #4
0
        public void addNodeTest()
        {
            Project test = new Project("myProject", "test/testing/myproject.oqatProj", "testprojekt zum testen");
            Video vid1 = new Video(false, "test/testing/vid1.yuf");
            Video vid2 = new Video(false, "test/testing/vid2.yuf");
            Video vid3 = new Video(false, "test/testing/vid3.yuf");
            Video vid4 = new Video(false, "test/testing/vid3.yuf");

            test.addNode(vid1, -1);
            Assert.AreEqual(test.smartTree.Count, 1);
            test.rmNode(0, false);
            Assert.AreEqual(test.smartTree.Count, 0);

            test.addNode(vid1, -1);
            test.addNode(vid2, 1);
            test.addNode(vid3, 2);
            Assert.AreEqual(test.smartTree.Count, 1);

            test.rmNode(2, false);
            Assert.AreEqual(test.smartTree.Count, 1);

            test.addNode(vid2, -1);
            test.addNode(vid2, -1);
            Assert.AreEqual(test.smartTree.Count, 3);

            Project test2 = new Project("myProject", "test/testing/myproject.oqatProj", "testprojekt zum testen");
            test2.addNode(vid1, -1);
            test2.addNode(vid2, 0);
            test2.addNode(vid3, 0);

            test2.rmNode(0, true);
            Assert.AreEqual(test2.smartTree.Count, 0);

            Project test3 = new Project("myProject", "test/testing/myproject.oqatProj", "testprojekt zum testen");
            test3.addNode(vid1, -1);
            test3.addNode(vid2, 0);
            test3.addNode(vid3, 0);

            test3.rmNode(0, false);
            Assert.AreEqual(test3.smartTree.Count, 2);

            try
            {
                test.addNode(null, -1);
                Assert.Fail("no exception thrown");
            }
            catch (Exception)
            {

            }
            try
            {
                test.smartTree.Clear();
                test.addNode(vid1, 0);
                Assert.Fail("no exception thrown");
            }
            catch (Exception)
            {

            }
            try
            {
                test.smartTree.Clear();
                test.rmNode(0,true);
                Assert.Fail("no exception thrown");
            }
            catch (Exception)
            {

            }
        }
Пример #5
0
        public void ProjectConstructorTest()
        {
            Project test = new Project("myProject","test/testing/myproject.oqatProj","testprojekt zum testen");
            Assert.AreEqual(test.name, "myProject");
            Assert.AreEqual(test.path_Project, "test/testing/myproject.oqatProj");
            Assert.AreEqual(test.description, "testprojekt zum testen");

            Video vid1 = new Video(false,"test/testing/vid1.yuf");
            Video vid2 = new Video(false, "test/testing/vid2.yuf");
            SmartNode sm1 = new SmartNode(vid1,1,0);
            SmartNode sm2 = new SmartNode(vid2, 2, 0);
            test.smartTree.Add(sm1);
            test.smartTree.Add(sm2);
            Assert.AreEqual(test.smartTree.Count, 2);
        }