Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/19/14 15:52:56 (10 years ago)
Author:
pfleck
Message:

#2225
Fixed unit test for VRP instances.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.VehicleRouting-3.4/VRPInstancesTest.cs

    r11171 r11287  
    2121
    2222using System;
     23using System.Collections.Generic;
    2324using System.Linq;
    2425using System.Text;
    25 using HeuristicLab.PluginInfrastructure;
    26 using HeuristicLab.Problems.Instances.VehicleRouting;
     26using HeuristicLab.Problems.Instances;
     27using HeuristicLab.Tests;
    2728using Microsoft.VisualStudio.TestTools.UnitTesting;
    2829
     
    3031  [TestClass]
    3132  public class VRPInstancesTest {
     33    [ClassInitialize]
     34    public static void MyClassInitialize(TestContext testContext) {
     35      PluginLoader.Assemblies.Any();
     36    }
     37
    3238    [TestMethod]
    3339    [TestCategory("Problems.VehicleRouting")]
    3440    [TestProperty("Time", "long")]
    3541    public void TestVRPInstances() {
    36       var providers = ApplicationManager.Manager.GetInstances<VRPInstanceProvider>();
    3742      var vrp = new VehicleRoutingProblem();
     43      var providers = ProblemInstanceManager.GetProviders(vrp);
    3844      var failedInstances = new StringBuilder();
    3945
     
    4147
    4248      foreach (var provider in providers) {
    43         var instances = provider.GetDataDescriptors();
     49        IEnumerable<IDataDescriptor> instances = ((dynamic)provider).GetDataDescriptors();
    4450        Assert.IsTrue(instances.Any(), "No instances could be found.");
    4551
     
    4753          try {
    4854            // throws InvalidOperationException if zero or more than one interpreter is found
    49             vrp.Load(provider.LoadData(instance));
     55            ((dynamic)vrp).Load(((dynamic)provider).LoadData(instance));
    5056          } catch (Exception exc) {
    5157            failedInstances.AppendLine(instance + ": " + exc.Message);
Note: See TracChangeset for help on using the changeset viewer.