Пример #1
0
        public void CreateUseCase()
        {
            UMLProject project = null;
            project = UMLProject.GetInstance();
            List<IUMLElement> elements = project.GetOwnedElements();

            if (elements.Count > 0)
            {
                UMLUseCase uc = new UMLUseCase();
                uc.Owner = elements[0];
                uc.Name = "UC Test";
                uc.Purpose = "Purpose";
                uc.Resume = "Resume";
                uc.Save();
                Assert.AreNotEqual(null, uc);
                Assert.AreNotEqual(String.Empty, uc.Guid);
                Assert.AreNotEqual(null, uc.Guid);
                
                Assert.AreEqual("UC Test", uc.Name);
                Assert.AreNotEqual(String.Empty, uc.Name);
                Assert.AreNotEqual(null, uc.Name);

                Assert.AreNotEqual(String.Empty, uc.PathName);
                Assert.AreNotEqual(null, uc.PathName);

                Assert.AreEqual("Purpose", uc.Purpose);
                Assert.AreNotEqual(String.Empty, uc.Purpose);
                Assert.AreNotEqual(null, uc.Purpose);

                Assert.AreEqual("Resume", uc.Resume);
                Assert.AreNotEqual(String.Empty, uc.Resume);
                Assert.AreNotEqual(null, uc.Resume);
            }
        }
Пример #2
0
        public void CreateUseCase()
        {
            UMLProject project = null;

            project = UMLProject.GetInstance();
            List <IUMLElement> elements = project.GetOwnedElements();

            if (elements.Count > 0)
            {
                UMLUseCase uc = new UMLUseCase();
                uc.Owner   = elements[0];
                uc.Name    = "UC Test";
                uc.Purpose = "Purpose";
                uc.Resume  = "Resume";
                uc.Save();
                Assert.AreNotEqual(null, uc);
                Assert.AreNotEqual(String.Empty, uc.Guid);
                Assert.AreNotEqual(null, uc.Guid);

                Assert.AreEqual("UC Test", uc.Name);
                Assert.AreNotEqual(String.Empty, uc.Name);
                Assert.AreNotEqual(null, uc.Name);

                Assert.AreNotEqual(String.Empty, uc.PathName);
                Assert.AreNotEqual(null, uc.PathName);

                Assert.AreEqual("Purpose", uc.Purpose);
                Assert.AreNotEqual(String.Empty, uc.Purpose);
                Assert.AreNotEqual(null, uc.Purpose);

                Assert.AreEqual("Resume", uc.Resume);
                Assert.AreNotEqual(String.Empty, uc.Resume);
                Assert.AreNotEqual(null, uc.Resume);
            }
        }
Пример #3
0
        public UseCaseEdit(UMLUseCase useCase)
        {
            InitializeComponent();

            this.DataBindings.Add(new System.Windows.Forms.Binding("Name", this.uMLUseCaseBindingSource, "PathName", true, System.Windows.Forms.DataSourceUpdateMode.OnValidation, "New Use Case"));
            this.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.uMLUseCaseBindingSource, "PathName", true, System.Windows.Forms.DataSourceUpdateMode.OnValidation, "New Use Case"));
            this.DataBindings.Add(new System.Windows.Forms.Binding("TabText", this.uMLUseCaseBindingSource, "PathName", true, System.Windows.Forms.DataSourceUpdateMode.OnValidation, "New Use Case"));
            this.DataBindings.Add(new System.Windows.Forms.Binding("ToolTipText", this.uMLUseCaseBindingSource, "PathName", true, System.Windows.Forms.DataSourceUpdateMode.OnValidation, "New Use Case"));

            this.UseCase = useCase;
        }
Пример #4
0
        public UseCaseEdit(UMLUseCase useCase)
        {
            InitializeComponent();

            this.DataBindings.Add(new System.Windows.Forms.Binding("Name", this.uMLUseCaseBindingSource, "PathName", true, System.Windows.Forms.DataSourceUpdateMode.OnValidation, "New Use Case"));
            this.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.uMLUseCaseBindingSource, "PathName", true, System.Windows.Forms.DataSourceUpdateMode.OnValidation, "New Use Case"));
            this.DataBindings.Add(new System.Windows.Forms.Binding("TabText", this.uMLUseCaseBindingSource, "PathName", true, System.Windows.Forms.DataSourceUpdateMode.OnValidation, "New Use Case"));
            this.DataBindings.Add(new System.Windows.Forms.Binding("ToolTipText", this.uMLUseCaseBindingSource, "PathName", true, System.Windows.Forms.DataSourceUpdateMode.OnValidation, "New Use Case"));

            this.UseCase = useCase;
        }
Пример #5
0
        public void CreateCollaboration()
        {
            UMLProject project = null;
            project = UMLProject.GetInstance();
            List<IUMLElement> elements = project.GetOwnedElements();

            if (elements.Count > 0)
            {
                UMLUseCase uc = new UMLUseCase();
                uc.Owner = elements[0];
                uc.Name = "UC Test Collaboration";                
                uc.Save();

                UMLCollaboration coll = new UMLCollaboration();
                coll.Owner = uc;
                coll.Name = "Collaboration EI";
                coll.Type = UMLActionType.EI;
                coll.GenerateAction = true;
                coll.SendMessage = true;
                coll.Save();

                Assert.AreNotEqual(null, coll);
                Assert.AreNotEqual(String.Empty, coll.Guid);
                Assert.AreNotEqual(null, coll.Guid);
                Assert.AreEqual("Collaboration EI", coll.Name);
                Assert.AreNotEqual(String.Empty, coll.Name);
                Assert.AreNotEqual(null, coll.Name);

                Assert.AreNotEqual(String.Empty, coll.PathName);
                Assert.AreNotEqual(null, coll.PathName);

                Assert.AreEqual(UMLActionType.EI, coll.Type);

                Assert.AreEqual(true, coll.GenerateAction);
                Assert.AreEqual(true, coll.SendMessage);

                
                UMLCollaboration coll2 = new UMLCollaboration();
                coll2.Owner = uc;
                coll2.Name = "Collaboration EO";
                coll2.Type = UMLActionType.EO;
                coll2.GenerateAction = true;
                coll2.SendMessage = false;
                coll2.Save();

                Assert.AreNotEqual(null, coll2);
                Assert.AreNotEqual(String.Empty, coll2.Guid);
                Assert.AreNotEqual(null, coll2.Guid);

                Assert.AreEqual("Collaboration EO", coll2.Name);
                Assert.AreNotEqual(String.Empty, coll2.Name);
                Assert.AreNotEqual(null, coll2.Name);

                Assert.AreNotEqual(String.Empty, coll2.PathName);
                Assert.AreNotEqual(null, coll2.PathName);
                Assert.AreEqual(UMLActionType.EO, coll2.Type);

                Assert.AreEqual(true, coll2.GenerateAction);
                Assert.AreEqual(false, coll2.SendMessage);


                UMLCollaboration coll3 = new UMLCollaboration();
                coll3.Owner = uc;
                coll3.Name = "Collaboration EQ";
                coll3.Type = UMLActionType.EQ;
                coll3.Save();

                Assert.AreNotEqual(null, coll3);
                Assert.AreNotEqual(String.Empty, coll3.Guid);
                Assert.AreNotEqual(null, coll3.Guid);
                
                Assert.AreEqual("Collaboration EQ", coll3.Name);
                Assert.AreNotEqual(String.Empty, coll3.Name);
                Assert.AreNotEqual(null, coll3.Name);

                Assert.AreNotEqual(String.Empty, coll3.PathName);
                Assert.AreNotEqual(null, coll3.PathName);

                Assert.AreEqual(UMLActionType.EQ, coll3.Type);

                Assert.AreEqual(false, coll3.GenerateAction);
                Assert.AreEqual(false, coll3.SendMessage);
            }
        }
Пример #6
0
        public void CreateCollaboration()
        {
            UMLProject project = null;

            project = UMLProject.GetInstance();
            List <IUMLElement> elements = project.GetOwnedElements();

            if (elements.Count > 0)
            {
                UMLUseCase uc = new UMLUseCase();
                uc.Owner = elements[0];
                uc.Name  = "UC Test Collaboration";
                uc.Save();

                UMLCollaboration coll = new UMLCollaboration();
                coll.Owner          = uc;
                coll.Name           = "Collaboration EI";
                coll.Type           = UMLActionType.EI;
                coll.GenerateAction = true;
                coll.SendMessage    = true;
                coll.Save();

                Assert.AreNotEqual(null, coll);
                Assert.AreNotEqual(String.Empty, coll.Guid);
                Assert.AreNotEqual(null, coll.Guid);
                Assert.AreEqual("Collaboration EI", coll.Name);
                Assert.AreNotEqual(String.Empty, coll.Name);
                Assert.AreNotEqual(null, coll.Name);

                Assert.AreNotEqual(String.Empty, coll.PathName);
                Assert.AreNotEqual(null, coll.PathName);

                Assert.AreEqual(UMLActionType.EI, coll.Type);

                Assert.AreEqual(true, coll.GenerateAction);
                Assert.AreEqual(true, coll.SendMessage);


                UMLCollaboration coll2 = new UMLCollaboration();
                coll2.Owner          = uc;
                coll2.Name           = "Collaboration EO";
                coll2.Type           = UMLActionType.EO;
                coll2.GenerateAction = true;
                coll2.SendMessage    = false;
                coll2.Save();

                Assert.AreNotEqual(null, coll2);
                Assert.AreNotEqual(String.Empty, coll2.Guid);
                Assert.AreNotEqual(null, coll2.Guid);

                Assert.AreEqual("Collaboration EO", coll2.Name);
                Assert.AreNotEqual(String.Empty, coll2.Name);
                Assert.AreNotEqual(null, coll2.Name);

                Assert.AreNotEqual(String.Empty, coll2.PathName);
                Assert.AreNotEqual(null, coll2.PathName);
                Assert.AreEqual(UMLActionType.EO, coll2.Type);

                Assert.AreEqual(true, coll2.GenerateAction);
                Assert.AreEqual(false, coll2.SendMessage);


                UMLCollaboration coll3 = new UMLCollaboration();
                coll3.Owner = uc;
                coll3.Name  = "Collaboration EQ";
                coll3.Type  = UMLActionType.EQ;
                coll3.Save();

                Assert.AreNotEqual(null, coll3);
                Assert.AreNotEqual(String.Empty, coll3.Guid);
                Assert.AreNotEqual(null, coll3.Guid);

                Assert.AreEqual("Collaboration EQ", coll3.Name);
                Assert.AreNotEqual(String.Empty, coll3.Name);
                Assert.AreNotEqual(null, coll3.Name);

                Assert.AreNotEqual(String.Empty, coll3.PathName);
                Assert.AreNotEqual(null, coll3.PathName);

                Assert.AreEqual(UMLActionType.EQ, coll3.Type);

                Assert.AreEqual(false, coll3.GenerateAction);
                Assert.AreEqual(false, coll3.SendMessage);
            }
        }
Пример #7
0
 private void newUseCaseToolStripMenuItem_Click(object sender, EventArgs e)
 {
     UMLUseCase useCase = new UMLUseCase();
     NewFormEdit(useCase);
 }
Пример #8
0
        private void newUseCaseToolStripMenuItem_Click(object sender, EventArgs e)
        {
            UMLUseCase useCase = new UMLUseCase();

            NewFormEdit(useCase);
        }
Пример #9
0
 /// <summary>
 /// Adds a new use case
 /// </summary>
 /// <param name="useCase"></param>
 /// <returns></returns>
 private UMLUseCase AddUseCase(UMLUseCase useCase)
 {
     foreach (UMLUseCase u in UseCases)
     {
         //if (useCase.Name == u.Name && useCase.Owner == u.Owner)
         if (useCase.Name == u.Name)
         {
             u.Owner = useCase.Owner;
             u.Collaborations = useCase.Collaborations;
             return u;
         }
     }
     UseCases.Add(useCase);
     return useCase;
 }
Пример #10
0
        /// <summary>
        /// Loads the use cases and collaborations
        /// </summary>
        public void LoadUseCasesCollaborationsExcel()
        {
            DataTable dtResult = new DataTable();
            dtResult = GetDataTable(_fileName, COLLABORATION_SHEET, "Name <> ''");

            UMLPackage pack = new UMLPackage();
            pack.Name = "UseCaseImport";
            pack.Owner = _scenariosModel;
            Packages.Add(pack);

            foreach (DataRow dr in dtResult.Rows)
            {
                UMLUseCase useCase = new UMLUseCase();
                useCase.Name = dr["UseCase"].ToString().Trim();
                useCase.Owner = pack;
                useCase = AddUseCase(useCase);

                UMLCollaboration collaboration = new UMLCollaboration();
                collaboration.Name = dr["Name"].ToString().Trim();
                collaboration.Type = dr["Type"].ToString();

                if (dr["SendMessage"].ToString() == "X")
                {
                    collaboration.SendMessage = true;
                }

                if (dr["GenerateAction"].ToString() == "X")
                {
                    collaboration.GenerateAction = true;
                }

                string[] filesName = dr["FilesList"].ToString().Split(',');
                foreach (string fName in filesName)
                {
                    UMLFile file = new UMLFile();
                    file.Name = fName.Trim();
                    file = AddFile(file);
                    collaboration.Files.Add(file);
                }

                collaboration.Owner = useCase;
                collaboration = AddCollaboration(collaboration);
                useCase.Collaborations.Add(collaboration);
            }
        }
Пример #11
0
        /// <summary>
        /// Loads the iterations and phases
        /// </summary>
        public void LoadPhasesIterationsExcel()
        {
            DataTable dtResult = new DataTable();
            dtResult = GetDataTable(_fileName, PHASE_SHEET, "Phase <> ''");
            UMLPackage pack = new UMLPackage();
            pack.Name = "IterationsFaseImport";
            pack.Owner = _iterationModel;

            Packages.Add(pack);
            foreach (DataRow dr in dtResult.Rows)
            {
                UMLPhase phase = new UMLPhase();
                phase.Name = dr["Phase"].ToString().Trim();
                phase.Owner = pack;
                phase = AddPhase(phase);

                UMLIteration iteration = new UMLIteration();
                iteration.Name = dr["Name"].ToString().Trim();
                string[] usecasesName = dr["UseCaseList"].ToString().Split(',');
                foreach (string useCaseName in usecasesName)
                {
                    UMLUseCase useCase = new UMLUseCase();
                    useCase.Name = useCaseName.Trim();
                    useCase = AddUseCase(useCase);
                    iteration.UseCases.Add(useCase);
                }

                //iteration.Owner = _logical;
                iteration.Owner = phase;
                iteration = AddIteration(iteration);
                iteration.Prev = getIterationByName(dr["Prev"].ToString());
                phase.Iterations.Add(iteration);
            }
        }