Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4661


Ignore:
Timestamp:
10/29/10 15:11:29 (14 years ago)
Author:
mkommend
Message:

Added check for existence of the clone method in CloningConstructorTest (ticket #922).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/CloningRefactoring/HeuristicLab/3.3/Tests/CloningConstructorTest.cs

    r4660 r4661  
    3535        if (!found)
    3636          errorMessage.Append(Environment.NewLine + deepCloneableType.ToString() + ": No cloning constructor is defined.");
     37
     38        if (!deepCloneableType.IsAbstract) {
     39          MethodInfo cloneMethod = deepCloneableType.GetMethod("Clone", new Type[] { typeof(Cloner) });
     40          if (cloneMethod == null)
     41            errorMessage.Append(Environment.NewLine + deepCloneableType.ToString() + ": No virtual cloning method is defined.");
     42        }
    3743      }
    3844      Assert.IsTrue(errorMessage.Length == 0, errorMessage.ToString());
Note: See TracChangeset for help on using the changeset viewer.