Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/23/16 19:31:18 (7 years ago)
Author:
bburlacu
Message:

#2685: Add correction step for values miscalculated due to cyclical symbol dependencies in the grammar. Updated unit test.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Encodings.PermutationEncoding-3.3/CyclicCrossover2Test.cs

    r14185 r14353  
    2020#endregion
    2121
     22using HeuristicLab.Core;
    2223using HeuristicLab.Tests;
    2324using Microsoft.VisualStudio.TestTools.UnitTesting;
     
    3031  [TestClass()]
    3132  public class CyclicCrossover2Test {
     33    /// <summary>
     34    ///A test for Cross
     35    ///</summary>
     36    [TestMethod]
     37    [TestCategory("Encodings.Permutation")]
     38    [TestProperty("Time", "short")]
     39    public void CyclicCrossover2CrossTest() {
     40      TestRandom random = new TestRandom();
     41      var privateObject = new PrivateObject(typeof(CyclicCrossover2));
     42      // perform a test with more than two parents
     43      random.Reset();
     44      bool exceptionFired = false;
     45      try {
     46        privateObject.Invoke("Cross", random, new ItemArray<Permutation>(new Permutation[] {
     47          new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4)}));
     48      }
     49      catch (System.InvalidOperationException) {
     50        exceptionFired = true;
     51      }
     52      Assert.IsTrue(exceptionFired);
     53    }
     54
    3255    /// <summary>
    3356    ///A test for Apply
Note: See TracChangeset for help on using the changeset viewer.