Exemple #1
0
        public void TestReflectionMagic()
        {
            simpleProj = new MSProject("..\\UnitTests\\artifacts\\DataMapping_Text_1.xml");
            simpleProj.LoadProjectFilePath = "..\\UnitTests\\artifacts\\MSProject_Test_0.mpp";
            simpleProj.InputPath           = "..\\UnitTests\\artifacts\\single_bug.xml";
            simpleProj.InputType           = InputDataFormat.BugzillaXML;
            simpleProj.SaveProjectFilePath = "..\\UnitTests\\artifacts\\MSProject_Test_0.mpp";
            simpleProj.LoadMPP();
            simpleProj.Update();

            foreach (Task task in simpleProj.Project.Tasks)
            {
                if (task.Number1 == 71)
                {
                    Assert.AreEqual(String.Compare(task.ResourceNames, "David McCormack"), 0);
                    Assert.AreEqual(String.Compare(task.Text1, "FUTURE"), 0);
                    Assert.AreEqual(String.Compare(task.Name, "Program crashes"), 0);
                    Assert.AreEqual(task.Number1, 71);
                    Assert.AreEqual(String.Compare(task.Text2, "NEW"), 0);
                    Assert.AreEqual(String.Compare(task.Text4, "normal"), 0);
                    Assert.AreEqual(task.Priority, 500);
                    Assert.AreEqual(String.Compare(task.Text1, "FUTURE"), 0);
                }
            }
            SimpleProjectClose();
            simpleProj = null;
        }
Exemple #2
0
        public void CreateSingleProjectTaskFromXML()
        {
            SimpleProjectInit();
            simpleProj.LoadMPP();
            simpleProj.Update();

            foreach (Task task in simpleProj.Project.Tasks)
            {
                if (task.Number1 == 71)
                {
                    Assert.AreEqual(String.Compare(task.Name, "Program crashes"), 0);
                    Assert.AreEqual(task.Number1, 71);
                    Assert.AreEqual(task.Priority, 500);
                    Assert.AreEqual(String.Compare(task.Text1, "FUTURE"), 0);
                    Assert.AreEqual(String.Compare(task.ResourceNames, "David McCormack"), 0);
                }
            }
            SimpleProjectClose();
            simpleProj = null;
        }
Exemple #3
0
        public static void Generate(MSProject proj)
        {
            #region Pre Conditions
            Debug.Assert(null != proj.LoadProjectFilePath);
            Debug.Assert(null != proj.SaveProjectFilePath);
            Debug.Assert(null != proj.InputPath);
            Debug.Assert(InputDataFormat.None != proj.InputType);
            #endregion

            if ((proj.SaveProjectFilePath != null) && (proj.LoadProjectFilePath != null) && (proj.InputPath != null))
            {
                proj.LoadMPP();
                proj.Update();
                proj.SaveMPP();
                proj.Close();
            }
            else
            {
                MessageBox.Show("Unable to load one of {LoadProjectFilePath, SaveProjectFilePath, bugzillaXMLFilePath}", "File not Errror", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #4
0
        public void TestDependsOn()
        {
            simpleProj = new MSProject("..\\UnitTests\\artifacts\\DataMapping_Text_1.xml");
            simpleProj.LoadProjectFilePath = "..\\UnitTests\\artifacts\\MSProject_Test_0.mpp";
            simpleProj.SaveProjectFilePath = "..\\UnitTests\\artifacts\\MSProject_Test_0.mpp";
            simpleProj.InputPath           = "..\\UnitTests\\artifacts\\two_bugs.xml";
            simpleProj.InputType           = InputDataFormat.BugzillaXML;
            simpleProj.LoadMPP();
            simpleProj.Update();

            foreach (Task task in simpleProj.Project.Tasks)
            {
                if (task.Number1 == 14963)
                {
                    Console.WriteLine(task.Predecessors);
                    Assert.IsTrue(task.Predecessors.Contains("6"));
                    Assert.IsTrue(task.Predecessors.Contains("4"));
                    Assert.IsTrue(task.Predecessors.Contains("3"));
                    break;
                }
            }
            SimpleProjectClose();
            simpleProj = null;
        }