Exemplo n.º 1
0
        public static BugTracking.DeveloperBug getBug()
        {
            BugTracking.User user = new BugTracking.User("FirstName", "LastName", "Developer");
            user.Save();
            BugTracking.App app = new BugTracking.App("TestApp1", user);
            app.Save();

            BugTracking.AppForm form = new BugTracking.AppForm("Label Test", "Name Test", true, app.Id);
            form.Save();

            BugTracking.FormControl control = new BugTracking.FormControl("label Test", "Name Test", true, app.Id);
            control.Save();

            BugTracking.Action action = new BugTracking.Action("label Test", "Name Test", app.Id);

            BugTracking.BugLocation location = new BugTracking.BugLocation(app.Id, form.Id, control.Id, action.Name, "Related Method Test", "Related Parameter Test", 1, 99);

            BugTracking.DeveloperBug bug = new BugTracking.DeveloperBug("Test Title", "Test Comment", location, 0, -1, false, "Dummy Code");


            bug.createdByID = user.Id;


            bug.AssignedUserID = user.Id;
            bug.Save();

            return(bug);
        }
Exemplo n.º 2
0
        public void TestAppCreate()
        {
            BugTracking.User user = new BugTracking.User("FirstName", "LastName", "Developer");
            user.Save();
            BugTracking.App app = new BugTracking.App("TestApp1", user);
            app.Save();

            BugTracking.App testapp = new BugTracking.App(app.Id);

            Boolean AllFound = true;

            if (testapp.DefaultUser.Id != app.DefaultUser.Id)
            {
                //app retreived

                AllFound = false;
            }
            if (testapp.Id != app.Id)
            {
                //app retreived

                AllFound = false;
            }
            if (testapp.Name != "TestApp1")
            {
                AllFound = false;
            }

            user.Delete();
            app.Delete();

            Assert.AreEqual(AllFound, true);
        }
Exemplo n.º 3
0
        public void TestControlCreate()
        {
            BugTracking.User user = new BugTracking.User("FirstName", "LastName", "Developer");
            user.Save();
            BugTracking.App app = new BugTracking.App("TestApp1", user);
            app.Save();

            BugTracking.FormControl control = new BugTracking.FormControl("label Test", "Name Test", true, app.Id);
            control.Save();


            BugTracking.FormControl Testcontrol = new BugTracking.FormControl(control.Id);

            Boolean AllFound = true;

            if (Testcontrol.Label != control.Label)
            {
                //app retreived

                AllFound = false;
            }
            if (Testcontrol.Name != control.Name)
            {
                //app retreived

                AllFound = false;
            }
            if (Testcontrol.Active != control.Active)
            {
                //app retreived

                AllFound = false;
            }
            if (Testcontrol.ApplicationID != control.ApplicationID)
            {
                //app retreived

                AllFound = false;
            }



            user.Delete();
            control.Delete();
            app.Delete();


            Assert.AreEqual(AllFound, true);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Saves Application with form, controls and action.
        /// </summary>
        private void btnApplicationSave_Click(object sender, EventArgs e)
        {
            BugTracking.App selectedApp;
            //if application is new then add to app list
            if (cboApplication.SelectedValue == null)
            {
                selectedApp = new BugTracking.App(cboApplication.SelectedText);
                selectedApp.Save();

                AppList.Add(selectedApp);
            }
            else
            {//else update exisiting app
                selectedApp             = (BugTracking.App)cboApplication.SelectedItem;
                selectedApp.DefaultUser = (BugTracking.Developer)cboDefaultUser.SelectedItem;
                selectedApp.Save();
            }

            //save each form that has not been saved before
            foreach (BugTracking.AppForm form in FormList)
            {
                if (form.Id == 0)
                {
                    form.ApplicationID = selectedApp.Id;
                    form.Save();
                }
            }
            //save each control that has not been saved before
            foreach (BugTracking.FormControl control in ControlList)
            {
                if (control.Id == 0)
                {
                    control.ApplicationID = selectedApp.Id;
                    control.Save();
                }
            }
            //save each action that has not been saved before
            foreach (BugTracking.Action action in ActionList)
            {
                if (action.Id == 0)
                {
                    action.ApplicationId = selectedApp.Id;
                    action.Save();
                }
            }

            this.Close();
        }
Exemplo n.º 5
0
        public void TestDeveloperBugCreate()
        {
            //public BugLocation(long applicationID, long formID, long controlID, string action, string relatedMethod, string relatedParameter, long startLineNumber, long endlineNumber)

            //create dummy controls
            BugTracking.User user = new BugTracking.User("FirstName", "LastName", "Developer");
            user.Save();
            BugTracking.App app = new BugTracking.App("TestApp1", user);
            app.Save();

            BugTracking.AppForm form = new BugTracking.AppForm("Label Test", "Name Test", true, app.Id);
            form.Save();

            BugTracking.FormControl control = new BugTracking.FormControl("label Test", "Name Test", true, app.Id);
            control.Save();

            BugTracking.Action action = new BugTracking.Action("label Test", "Name Test", app.Id);

            BugTracking.BugLocation location = new BugTracking.BugLocation(app.Id, form.Id, control.Id, action.Name, "Related Method Test", "Related Parameter Test", 1, 99);

            BugTracking.DeveloperBug bug = new BugTracking.DeveloperBug("Test Title", "Test Comment", location, 0, -1, false, "Dummy Code");


            bug.createdByID = user.Id;


            bug.AssignedUserID = user.Id;
            bug.Save();

            BugTracking.Bug commitedBug = new BugTracking.Bug(bug.Id);


            Boolean AllFound = true;

            if (user.Id != commitedBug.AssignedUserID)
            {
                //app retreived

                AllFound = false;
            }
            if (user.Id != commitedBug.createdByID)
            {
                //app retreived

                AllFound = false;
            }
            if (app.Id != commitedBug.Location.application.Id)
            {
                //app retreived

                AllFound = false;
            }
            if (form.Id != commitedBug.Location.form.Id)
            {
                //form retreived
                AllFound = false;
            }
            if (control.Id != commitedBug.Location.control.Id)
            {
                //control retreived
                AllFound = false;
            }
            if (action.Name != commitedBug.Location.action)
            {
                //action retreived

                AllFound = false;
            }
            if (location.Id != commitedBug.Location.Id)
            {
                //location retreived

                AllFound = false;
            }
            if (bug.Id != commitedBug.Id)
            {
                //app retreived

                AllFound = false;
            }



            user.Delete();
            control.Delete();
            form.Delete();
            app.Delete();
            location.Delete();
            bug.Delete();

            Assert.AreEqual(AllFound, true);
        }
Exemplo n.º 6
0
        public void TestAppFormCreate()
        {
            BugTracking.Developer user = new BugTracking.Developer("FirstName", "LastName", "Developer");
            user.Save();
            BugTracking.App app = new BugTracking.App("TestApp1", user);
            app.Save();

            BugTracking.AppForm form = new BugTracking.AppForm("Label Test", "Name Test", true, app.Id);
            form.Save();

            BugTracking.AppForm testform = new BugTracking.AppForm(form.Id);


            Boolean AllFound = true;

            if (testform.Id != form.Id)
            {
                //app retreived

                AllFound = false;
            }
            if (testform.ApplicationID != app.Id)
            {
                //app retreived

                AllFound = false;
            }

            BugTracking.App testApp = new BugTracking.App(testform.ApplicationID);
            if (user.Id != testApp.DefaultUser.Id)
            {
                //app retreived

                AllFound = false;
            }
            if (form.Id != form.Id)
            {
                //form retreived
                AllFound = false;
            }
            if (form.Label != "Label Test")
            {
                //form retreived
                AllFound = false;
            }
            if (form.Name != "Name Test")
            {
                //form retreived
                AllFound = false;
            }
            if (form.Active != true)
            {
                //form retreived
                AllFound = false;
            }

            user.Delete();
            app.Delete();
            form.Delete();

            Assert.AreEqual(AllFound, true);
        }