Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/04/10 15:15:44 (14 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/OrderCrossover2Test.cs

    r2929 r2930  
    11using HeuristicLab.Core;
    22using Microsoft.VisualStudio.TestTools.UnitTesting;
     3using HeuristicLab.Encodings.Permutation;
    34
    45namespace HeuristicLab.Encodings.Permutation_33.Tests {
     
    6869      bool exceptionFired = false;
    6970      try {
    70         target.Cross(random, new ItemArray<Permutation>(new Permutation[] {
    71           new Permutation(4), new Permutation(4), new Permutation(4)}));
     71        target.Cross(random, new ItemArray<Permutation.Permutation>(new Permutation.Permutation[] {
     72          new Permutation.Permutation(4), new Permutation.Permutation(4), new Permutation.Permutation(4)}));
    7273      } catch (System.InvalidOperationException) {
    7374        exceptionFired = true;
     
    8283    public void OrderCrossover2ApplyTest() {
    8384      TestRandom random = new TestRandom();
    84       Permutation parent1, parent2, expected, actual;
     85      Permutation.Permutation parent1, parent2, expected, actual;
    8586      // The following test is based on an example from Affenzeller, M. et al. 2009. Genetic Algorithms and Genetic Programming - Modern Concepts and Practical Applications. CRC Press. p. 135.
    8687      random.Reset();
    8788      random.IntNumbers = new int[] { 5, 7 };
    88       parent1 = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 });
     89      parent1 = new Permutation.Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 });
    8990      Assert.IsTrue(parent1.Validate());
    90       parent2 = new Permutation(new int[] { 2, 5, 6, 0, 9, 1, 3, 8, 4, 7 });
     91      parent2 = new Permutation.Permutation(new int[] { 2, 5, 6, 0, 9, 1, 3, 8, 4, 7 });
    9192      Assert.IsTrue(parent2.Validate());
    92       expected = new Permutation(new int[] { 2, 0, 9, 1, 3, 5, 6, 7, 8, 4 });
     93      expected = new Permutation.Permutation(new int[] { 2, 0, 9, 1, 3, 5, 6, 7, 8, 4 });
    9394      Assert.IsTrue(expected.Validate());
    9495      actual = OrderCrossover2.Apply(random, parent1, parent2);
     
    100101      bool exceptionFired = false;
    101102      try {
    102         OrderCrossover.Apply(random, new Permutation(8), new Permutation(6));
     103        OrderCrossover.Apply(random, new Permutation.Permutation(8), new Permutation.Permutation(6));
    103104      } catch (System.ArgumentException) {
    104105        exceptionFired = true;
     
    106107      Assert.IsTrue(exceptionFired);
    107108    }
    108 
    109     /// <summary>
    110     ///A test for OrderCrossover2 Constructor
    111     ///</summary>
    112     [TestMethod()]
    113     public void OrderCrossover2ConstructorTest() {
    114       OrderCrossover2 target = new OrderCrossover2();
    115     }
    116109  }
    117110}
Note: See TracChangeset for help on using the changeset viewer.