Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5151 for trunk/sources


Ignore:
Timestamp:
12/21/10 16:39:56 (13 years ago)
Author:
mkommend
Message:

Corrected CloningConstructorTest and StorableConstructorTest to test only HL plugin assemblies (ticket #1351).

Location:
trunk/sources/HeuristicLab/3.3/Tests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab/3.3/Tests/CloningConstructorTest.cs

    r4722 r5151  
    2121
    2222      foreach (Type deepCloneableType in ApplicationManager.Manager.GetTypes(typeof(IDeepCloneable))) {
     23        //test only types contained in HL plugin assemblies
     24        if (!PluginLoader.pluginAssemblies.Contains(deepCloneableType.Assembly)) break;
     25
    2326        bool found = false;
    2427        foreach (ConstructorInfo constructor in deepCloneableType.GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public)) {
  • trunk/sources/HeuristicLab/3.3/Tests/PluginLoader.cs

    r4512 r5151  
    1010  internal static class PluginLoader {
    1111    public const string AssemblyExtension = ".dll";
     12    public const string TestAccessorAssemblyExtension = "_Accessor.dll";
     13    public const string TestAssemblyExtension = ".test.dll";
    1214    public static List<Assembly> pluginAssemblies;
    1315
    1416    static PluginLoader() {
    1517      foreach (string path in Directory.EnumerateFiles(Environment.CurrentDirectory)
    16         .Where(s => s.EndsWith(AssemblyExtension)))
     18        .Where(s => s.EndsWith(AssemblyExtension) && !s.EndsWith(TestAccessorAssemblyExtension) && !s.EndsWith(TestAssemblyExtension)))
    1719        Assembly.LoadFrom(path);
    1820
  • trunk/sources/HeuristicLab/3.3/Tests/StorableConstructorTest.cs

    r4722 r5151  
    2525      foreach (Type storableType in ApplicationManager.Manager.GetTypes(typeof(object))
    2626        .Where(t => StorableClassAttribute.IsStorableClass(t))) {
     27        //test only types contained in HL plugin assemblies
     28        if (!PluginLoader.pluginAssemblies.Contains(storableType.Assembly)) break;
     29
    2730        IEnumerable<ConstructorInfo> ctors = storableType.GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
    2831        ConstructorInfo storableConstructor = ctors.Where(c => c.GetParameters().Count() == 1 && c.GetParameters().First().ParameterType == typeof(bool)).FirstOrDefault();
Note: See TracChangeset for help on using the changeset viewer.