Changeset 14029 for branches/crossvalidation-2434/HeuristicLab.Tests/HeuristicLab.Encodings.PermutationEncoding-3.3/MaximalPreservativeCrossoverTest.cs
- Timestamp:
- 07/08/16 14:40:02 (8 years ago)
- Location:
- branches/crossvalidation-2434
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/crossvalidation-2434
- Property svn:mergeinfo changed
-
branches/crossvalidation-2434/HeuristicLab.Tests
- Property svn:mergeinfo changed
-
branches/crossvalidation-2434/HeuristicLab.Tests/HeuristicLab.Encodings.PermutationEncoding-3.3/MaximalPreservativeCrossoverTest.cs
r12012 r14029 20 20 #endregion 21 21 22 using HeuristicLab.Core;23 22 using HeuristicLab.Tests; 24 23 using Microsoft.VisualStudio.TestTools.UnitTesting; … … 31 30 [TestClass()] 32 31 public class MaximalPreservativeCrossoverTest { 33 /// <summary>34 ///A test for Cross35 ///</summary>36 [TestMethod]37 [TestCategory("Encodings.Permutation")]38 [TestProperty("Time", "short")]39 public void MaximalPreservativeCrossoverCrossTest() {40 TestRandom random = new TestRandom();41 MaximalPreservativeCrossover_Accessor target =42 new MaximalPreservativeCrossover_Accessor(new PrivateObject(typeof(MaximalPreservativeCrossover)));43 // perform a test with more than two parents44 random.Reset();45 bool exceptionFired = false;46 try {47 target.Cross(random, new ItemArray<Permutation>(new Permutation[] {48 new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4)}));49 } catch (System.InvalidOperationException) {50 exceptionFired = true;51 }52 Assert.IsTrue(exceptionFired);53 }54 55 32 /// <summary> 56 33 ///A test for Apply … … 80 57 try { 81 58 MaximalPreservativeCrossover.Apply(random, new Permutation(PermutationTypes.RelativeUndirected, 8), new Permutation(PermutationTypes.RelativeUndirected, 6)); 82 } catch (System.ArgumentException) { 59 } 60 catch (System.ArgumentException) { 83 61 exceptionFired = true; 84 62 }
Note: See TracChangeset
for help on using the changeset viewer.