Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/18/15 13:01:38 (8 years ago)
Author:
ascheibe
Message:

#2510 merged r13227, r13235, r13236 into stable

Location:
stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Tests

  • stable/HeuristicLab.Tests/HeuristicLab.Encodings.RealVectorEncoding-3.3/LocalCrossoverTest.cs

    r12009 r13246  
    2020#endregion
    2121
    22 using HeuristicLab.Core;
    2322using HeuristicLab.Tests;
    2423using Microsoft.VisualStudio.TestTools.UnitTesting;
     
    3130  [TestClass()]
    3231  public class LocalCrossoverTest {
    33     /// <summary>
    34     ///A test for Cross
    35     ///</summary>
    36     [TestMethod()]
    37     [TestCategory("Encodings.RealVector")]
    38     [TestProperty("Time", "short")]
    39     public void LocalCrossoverCrossTest() {
    40       LocalCrossover_Accessor target = new LocalCrossover_Accessor(new PrivateObject(typeof(LocalCrossover)));
    41       ItemArray<RealVector> parents;
    42       TestRandom random = new TestRandom();
    43       bool exceptionFired;
    44       // The following test checks if there is an exception when there are more than 2 parents
    45       random.Reset();
    46       parents = new ItemArray<RealVector>(new RealVector[] { new RealVector(5), new RealVector(6), new RealVector(4) });
    47       exceptionFired = false;
    48       try {
    49         RealVector actual;
    50         actual = target.Cross(random, parents);
    51       } catch (System.ArgumentException) {
    52         exceptionFired = true;
    53       }
    54       Assert.IsTrue(exceptionFired);
    55       // The following test checks if there is an exception when there are less than 2 parents
    56       random.Reset();
    57       parents = new ItemArray<RealVector>(new RealVector[] { new RealVector(4) });
    58       exceptionFired = false;
    59       try {
    60         RealVector actual;
    61         actual = target.Cross(random, parents);
    62       } catch (System.ArgumentException) {
    63         exceptionFired = true;
    64       }
    65       Assert.IsTrue(exceptionFired);
    66     }
    67 
    6832    /// <summary>
    6933    ///A test for Apply
     
    9256      try {
    9357        actual = LocalCrossover.Apply(random, parent1, parent2);
    94       } catch (System.ArgumentException) {
     58      }
     59      catch (System.ArgumentException) {
    9560        exceptionFired = true;
    9661      }
Note: See TracChangeset for help on using the changeset viewer.