/// <summary> /// Compare lists of ControlledUpdateThing entities /// </summary> /// <param name="expected"></param> /// <param name="actual"></param> public static void Compare(ControlledUpdateThingList expected, ControlledUpdateThingList actual) { // Check for nulls if (expected == null && actual == null) { return; } if (expected == null) { Assert.Fail("Expected null, got list"); } if (actual == null) { Assert.Fail("Expected list, got null"); } // Check counts Assert.AreEqual(expected.Count, actual.Count, "List counts not equal"); // Now compare each entity in the list expected.SortById(); actual.SortById(); for (int index = 0; index < expected.Count; index++) { Compare(expected[index], actual[index]); } }
/// <summary> /// Returns a copy of the instance of ControlledUpdateThing /// </summary> /// <remarks> /// Overrides the base version, but calls OnClone to allow base classes chance /// to clone their information /// </remarks> public override object Clone() { // Create a new list. ControlledUpdateThingList clone = new ControlledUpdateThingList(); // Let the base class clone all of the items in our collection. OnClone(clone); // N.B. OnClone can be overridden in the handmade part of this // partial class to add extra code during clone (but make sure // you call the base version to copy the collection) // Return our pristine clone! return(clone); }