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

    r2929 r2930  
    2121
    2222using Microsoft.VisualStudio.TestTools.UnitTesting;
     23using HeuristicLab.Encodings.Permutation;
    2324
    2425namespace HeuristicLab.Encodings.Permutation_33.Tests {
     
    8384    public void Swap3ManipulatorApplyTest() {
    8485      TestRandom random = new TestRandom();
    85       Permutation parent, expected;
     86      Permutation.Permutation parent, expected;
    8687      // Test manipulator
    8788      random.Reset();
    8889      random.IntNumbers = new int[] { 1, 3, 6 };
    8990      random.DoubleNumbers = new double[] { 0 };
    90       parent = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 });
     91      parent = new Permutation.Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 });
    9192      Assert.IsTrue(parent.Validate());
    9293
    93       expected = new Permutation(new int[] { 0, 3, 2, 6, 4, 5, 1, 7, 8 });
     94      expected = new Permutation.Permutation(new int[] { 0, 3, 2, 6, 4, 5, 1, 7, 8 });
    9495      Assert.IsTrue(expected.Validate());
    9596      Swap3Manipulator.Apply(random, parent);
    9697      Assert.IsTrue(parent.Validate());
    9798      Assert.IsTrue(Auxiliary.PermutationIsEqualByPosition(expected, parent));
    98      
    99       // perform a test when the two permutations are of unequal length
    100       random.Reset();
    101       bool exceptionFired = false;
    102       try {
    103         CyclicCrossover.Apply(random, new Permutation(8), new Permutation(6));
    104       }
    105       catch (System.ArgumentException) {
    106         exceptionFired = true;
    107       }
    108       Assert.IsTrue(exceptionFired);
    109     }
    110 
    111     /// <summary>
    112     ///A test for Swap3Manipulator Constructor
    113     ///</summary>
    114     [TestMethod()]
    115     public void Swap3ManipulatorConstructorTest() {
    116       Swap3Manipulator target = new Swap3Manipulator();
    11799    }
    118100  }
Note: See TracChangeset for help on using the changeset viewer.