public Bug(string title, string description, ICollection <string> stepsToReproduce, PriorityType priorityType, BugSeverityType bugSeverityType, BugStatusType bugStatusType, IMember assignee) : base(title, description, priorityType, assignee) { this.stepsToReproduce = new List <string>(stepsToReproduce); this.PriorityType = priorityType; this.SeverityType = bugSeverityType; this.StatusType = bugStatusType; }
public override void ChangeStatus(string newStatus) { if (newStatus == null) { throw new ArgumentNullException(ModelConstants.InvalidNullStatus); } else { BugStatusType statusEnum = Enum.Parse <BugStatusType>(newStatus); this.StatusType = statusEnum; } }
//protected virtual List<Item> GetBugsWithStatus(BugStatusType bugStatus) //{ // List<Item> bugs = new List<Item>(); // if (this.Type == ItemType.Bug && (bugStatus == BugStatusType.None || this.State.CompareTo(bugStatus.ToString()) == 0)) // { bugs.Add(this.GetCopy()); } // foreach (var child in Children) // bugs.AddRange(child.GetBugsWithStatus(bugStatus)); // return bugs; //} internal virtual int GetNumberOfBugsWithStatus(BugStatusType bugStatus) { int noOfBugs = 0; if (this.Type == ItemType.Bug && (bugStatus == BugStatusType.None || this.State.CompareTo(bugStatus.ToString()) == 0)) { noOfBugs++; } foreach (var child in Children) { noOfBugs += child.GetNumberOfBugsWithStatus(bugStatus); } return(noOfBugs); }
public override void ChangeStatus(string newStatus) { if (newStatus == null) { throw new ArgumentNullException("Status cannot be null or empty!"); } else { //BugStatusType statusEnum = (BugStatusType)Enum.Parse(typeof(BugStatusType), newStatus, true); // LEGACY - има кастване, което се е правило преди дженериците. BugStatusType statusEnum = Enum.Parse <BugStatusType>(newStatus); this.Status = statusEnum; } }
public void ChangeStatus(BugStatusType bugStatusType) { this.StatusType = bugStatusType; }
CreateBug(string title, string description, ICollection <string> stepsToReproduce, PriorityType priorityType, BugSeverityType bugSeverityType, BugStatusType bugStatusType, IMember assignee) { return(new Bug(title, description, stepsToReproduce, priorityType, bugSeverityType, bugStatusType, assignee)); }