Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/04/10 15:15:44 (15 years ago)
Author:
abeham
Message:

fixed permutation tests due to namespace change #95
removed constructor tests as well

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.Permutation/3.3/Tests/MaximalPreservativeCrossoverTest.cs

    r2929 r2930  
    2222using HeuristicLab.Core;
    2323using Microsoft.VisualStudio.TestTools.UnitTesting;
     24using HeuristicLab.Encodings.Permutation;
    2425
    2526namespace HeuristicLab.Encodings.Permutation_33.Tests {
     
    9192      bool exceptionFired = false;
    9293      try {
    93         target.Cross(random, new ItemArray<Permutation>(new Permutation[] {
    94           new Permutation(4), new Permutation(4), new Permutation(4)}));
     94        target.Cross(random, new ItemArray<Permutation.Permutation>(new Permutation.Permutation[] {
     95          new Permutation.Permutation(4), new Permutation.Permutation(4), new Permutation.Permutation(4)}));
    9596      }
    9697      catch (System.InvalidOperationException) {
     
    106107    public void MaximalPreservativeCrossoverApplyTest() {
    107108      TestRandom random = new TestRandom();
    108       Permutation parent1, parent2, expected, actual;
     109      Permutation.Permutation parent1, parent2, expected, actual;
    109110      // The following test is based on an example from Larranaga, 1999. Genetic Algorithms for the Traveling Salesman Problem.
    110111      random.Reset();
    111112      random.IntNumbers = new int[] { 3, 2 };
    112       parent1 = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 });
     113      parent1 = new Permutation.Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 });
    113114      Assert.IsTrue(parent1.Validate());
    114       parent2 = new Permutation(new int[] { 1, 3, 5, 7, 6, 4, 2, 0 });
     115      parent2 = new Permutation.Permutation(new int[] { 1, 3, 5, 7, 6, 4, 2, 0 });
    115116      Assert.IsTrue(parent2.Validate());
    116       expected = new Permutation(new int[] { 1, 0, 2, 3, 4, 5, 7, 6 });
     117      expected = new Permutation.Permutation(new int[] { 1, 0, 2, 3, 4, 5, 7, 6 });
    117118      Assert.IsTrue(expected.Validate());
    118119      actual = MaximalPreservativeCrossover.Apply(random, parent1, parent2);
     
    124125      bool exceptionFired = false;
    125126      try {
    126         MaximalPreservativeCrossover.Apply(random, new Permutation(8), new Permutation(6));
     127        MaximalPreservativeCrossover.Apply(random, new Permutation.Permutation(8), new Permutation.Permutation(6));
    127128      }
    128129      catch (System.ArgumentException) {
     
    131132      Assert.IsTrue(exceptionFired);
    132133    }
    133 
    134     /// <summary>
    135     ///A test for OrderCrossover Constructor
    136     ///</summary>
    137     [TestMethod()]
    138     public void MaximalPreservativeCrossoverConstructorTest() {
    139       MaximalPreservativeCrossover target = new MaximalPreservativeCrossover();
    140     }
    141134  }
    142135}
Note: See TracChangeset for help on using the changeset viewer.