/// <summary> /// Compare lists of FieldTest entities /// </summary> /// <param name="expected"></param> /// <param name="actual"></param> public static void Compare(FieldTestList expected, FieldTestList 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> /// Populate FieldTestListUsingForeignKeyFieldNullable /// </summary> /// <param name="fieldTestList"></param> public void PopulateFieldTestListUsingForeignKeyFieldNullable(IEnumerable <FieldTest> fieldTestList) { if (fieldTestList == null) { _fieldTestListUsingForeignKeyFieldNullable = new FieldTestList(); } else { _fieldTestListUsingForeignKeyFieldNullable = new FieldTestList(fieldTestList); } }
/// <summary> /// Returns a copy of the instance of FieldTest /// </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. FieldTestList clone = new FieldTestList(); // 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); }
/// <summary> /// Clear all items from FieldTestListUsingForeignKeyFieldNullable and mark as not populated anymore /// </summary> public void UnpopulateFieldTestListUsingForeignKeyFieldNullable() { _fieldTestListUsingForeignKeyFieldNullable = null; }
/// <summary> /// Clear all items from FieldTestListUsingForeignKeyField and mark as not populated anymore /// </summary> public void UnpopulateFieldTestListUsingForeignKeyField() { _fieldTestListUsingForeignKeyField = null; }