private void Initialize() { this.id = TestId.Empty; this.name = string.Empty; this.owner = string.Empty; this.priority = DefaultPriority; this.storage = string.Empty; this.executionId = TestExecId.Empty; this.parentExecutionId = TestExecId.Empty; this.testCategories = new TestCategoryItemCollection(); this.isRunnable = true; this.catId = TestListCategoryId.Uncategorized; }
/// <summary> /// Compare the collection items /// </summary> /// <param name="obj">other collection</param> /// <returns>true if the collections contain the same items</returns> public override bool Equals(object obj) { TestCategoryItemCollection other = obj as TestCategoryItemCollection; bool result = false; if (other == null) { // Other object is not a TestCategoryItemCollection. result = false; } else if (Object.ReferenceEquals(this, other)) { // The other object is the same object as this one. result = true; } else if (this.Count != other.Count) { // The count of categories in the other object does not // match this one, so they are not equal. result = false; } else { // Check each item and return on the first mismatch. foreach (TestCategoryItem item in this) { if (!other.Contains(item)) { result = false; break; } } } return(result); }