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.IntegerVectorEncoding-3.3/DiscreteCrossoverTest.cs

    r12009 r13246  
    3232  public class DiscreteCrossoverTest {
    3333    /// <summary>
    34     ///A test for Cross
    35     ///</summary>
    36     [TestMethod]
    37     [TestCategory("Encodings.IntegerVector")]
    38     [TestProperty("Time", "short")]
    39     public void DiscreteCrossoverCrossTest() {
    40       DiscreteCrossover_Accessor target = new DiscreteCrossover_Accessor(new PrivateObject(typeof(DiscreteCrossover)));
    41       ItemArray<IntegerVector> parents;
    42       TestRandom random = new TestRandom();
    43       bool exceptionFired;
    44       // The following test checks if there is an exception when there are less than 2 parents
    45       random.Reset();
    46       parents = new ItemArray<IntegerVector>(new IntegerVector[] { new IntegerVector(4) });
    47       exceptionFired = false;
    48       try {
    49         IntegerVector actual;
    50         actual = target.Cross(random, parents);
    51       } catch (System.ArgumentException) {
    52         exceptionFired = true;
    53       }
    54       Assert.IsTrue(exceptionFired);
    55     }
    56 
    57     /// <summary>
    5834    ///A test for Apply
    5935    ///</summary>
     
    8258      try {
    8359        actual = DiscreteCrossover.Apply(random, new ItemArray<IntegerVector>(new IntegerVector[] { parent1, parent2 }));
    84       } catch (System.ArgumentException) {
     60      }
     61      catch (System.ArgumentException) {
    8562        exceptionFired = true;
    8663      }
Note: See TracChangeset for help on using the changeset viewer.