Пример #1
0
 private static Defect SetDefect(ExecutionEntry ee)
 {
     Defect defect = new Defect();
     defect.title = ee.ActualLog.Name;
     defect.symptom = ee.ActualLog.AggregatedDescription;
     defect.howFound = ee.ActualLog.NodePath;
     return defect;
 }
Пример #2
0
 private static Defect SetDefect(ExecutionEntry ee, List<string> attachment)
 {
     Defect defect = new Defect();
     defect.title = ee.ActualLog.Name;
     defect.symptom = ee.ActualLog.AggregatedDescription;
     defect.howFound = ee.ActualLog.NodePath;
     defect.attachmentList = attachment;
     return defect;
 }
Пример #3
0
        public DefectResult CreateBug(Defect defect)
        {
            DefectResult dr = new DefectResult();
            // gegevens uit Defect object in een work item zetten.
            wi.Fields["Title"].Value = defect.title;
            //wi.Fields["Description"].Value = defect.description;
            wi.Fields["How Found"].Value = defect.howFound;
            wi.Fields["Symptom"].Value = "<PRE>"+ defect.symptom + "</PRE>";

            if (defect.attachmentList != null)
            {
                foreach (string attachment in defect.attachmentList)
                {
                    if (File.Exists(attachment))
                    {
                        wi.Attachments.Add(new Attachment(attachment, "Added by Tosca Defect Tracker"));
                    }
                }
            }
            // static fields
            wi.Fields["BKR Priority"].Value = BKRpriority;
            wi.Fields["BKR Finding Type"].Value = BKRfindingType;

            #region Not used
            //wi.Fields["History"].Value = "";
            //wi.Fields["Iteration Path"].Value = "";
            //wi.Fields["Iteration ID"].Value = "";
            //wi.Fields["Activated Date"].Value = "";
            //wi.Fields["Activated By"].Value = "";
            //wi.Fields["Resolved Date"].Value = "";
            //wi.Fields["Resolved By"].Value = "";
            //wi.Fields["Resolved Reason"].Value = "";
            //wi.Fields["Stack Rank"].Value = "";
            //wi.Fields["Blocked"].Value = "";
            //wi.Fields["State"].Value = "";
            //wi.Fields["Changed By"].Value = "";
            //wi.Fields["Reason"].Value = "";
            //wi.Fields["Assigned To"].Value = "";
            //wi.Fields["BKR Clarify Date"].Value = "";
            //wi.Fields["Root Cause"].Value = "";
            //wi.Fields["Severity"].Value = "";
            //wi.Fields["System Info"].Value = "";
            //wi.Fields["Repro Steps"].Value = "";
            //wi.Fields["Found In Environment"].Value = "";
            //wi.Fields["Proposed Fix"].Value = "";
            //wi.Fields["BKR Clarify By"].Value = "";
            //wi.Fields["Area Path"].Value = "";
            //wi.Fields["Area ID"].Value = "";
            #endregion

            // work item valideren; controleren of alle verplichte velden gevuld zijn en of alle waarden correct zijn ingevuld
            ArrayList validationErrors = wi.Validate();

            // als er geen fouten zijn, work item opslaan en bugid ophalen
            if (validationErrors.Count == 0)
            {
                wi.Save();
                dr.id = wi.Id;
                dr.status = wi.State;
            }
            else
            {
                // foutmeldingen tonen
                foreach (Field field in validationErrors)
                {
                    System.Windows.Forms.MessageBox.Show("Validation Error in field " + field.ReferenceName);
                }
                dr.id = 0;
                dr.status = String.Empty;
            }
            return dr;
        }