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/ScrambleManipulatorTest.cs

    r2929 r2930  
    2121
    2222using Microsoft.VisualStudio.TestTools.UnitTesting;
     23using HeuristicLab.Encodings.Permutation;
    2324
    2425namespace HeuristicLab.Encodings.Permutation_33.Tests {
     
    8384    public void ScrambleManipulatorApplyTest() {
    8485      TestRandom random = new TestRandom();
    85       Permutation parent, expected;
     86      Permutation.Permutation parent, expected;
    8687      // The following test is based on an example from Larranaga, P. et al. 1999. Genetic Algorithms for the Travelling Salesman Problem: A Review of Representations and Operators. Artificial Intelligence Review, 13
    8788      random.Reset();
    8889      random.IntNumbers = new int[] { 3, 6, 1, 1, 1, 0 };
    89       parent = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 });
     90      parent = new Permutation.Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 });
    9091      Assert.IsTrue(parent.Validate());
    9192     
    92       expected = new Permutation(new int[] { 0, 1, 2, 4, 5, 6, 3, 7 });
     93      expected = new Permutation.Permutation(new int[] { 0, 1, 2, 4, 5, 6, 3, 7 });
    9394      Assert.IsTrue(expected.Validate());
    9495      ScrambleManipulator.Apply(random, parent);
    9596      Assert.IsTrue(parent.Validate());
    9697      Assert.IsTrue(Auxiliary.PermutationIsEqualByPosition(expected, parent));
    97      
    98       // perform a test when the two permutations are of unequal length
    99       random.Reset();
    100       bool exceptionFired = false;
    101       try {
    102         CyclicCrossover.Apply(random, new Permutation(8), new Permutation(6));
    103       }
    104       catch (System.ArgumentException) {
    105         exceptionFired = true;
    106       }
    107       Assert.IsTrue(exceptionFired);
    108     }
    109 
    110     /// <summary>
    111     ///A test for ScrambleManipulator Constructor
    112     ///</summary>
    113     [TestMethod()]
    114     public void ScrambleManipulatorConstructorTest() {
    115       ScrambleManipulator target = new ScrambleManipulator();
    11698    }
    11799  }
Note: See TracChangeset for help on using the changeset viewer.