Changeset 14029 for branches/crossvalidation-2434/HeuristicLab.Tests/HeuristicLab.Encodings.PermutationEncoding-3.3/PositionBasedCrossoverTest.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/PositionBasedCrossoverTest.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 PositionBasedCrossoverTest { 33 /// <summary>34 ///A test for Cross35 ///</summary>36 [TestMethod]37 [TestCategory("Encodings.Permutation")]38 [TestProperty("Time", "short")]39 public void PositionBasedCrossoverCrossTest() {40 TestRandom random = new TestRandom();41 PositionBasedCrossover_Accessor target = new PositionBasedCrossover_Accessor(42 new PrivateObject(typeof(PositionBasedCrossover)));43 44 // perform a test with more than two parents45 random.Reset();46 bool exceptionFired = false;47 try {48 target.Cross(random, new ItemArray<Permutation>(new Permutation[] {49 new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4) }));50 } catch (System.InvalidOperationException) {51 exceptionFired = true;52 }53 Assert.IsTrue(exceptionFired);54 }55 56 32 /// <summary> 57 33 ///A test for Apply … … 83 59 try { 84 60 PositionBasedCrossover.Apply(random, new Permutation(PermutationTypes.RelativeUndirected, 8), new Permutation(PermutationTypes.RelativeUndirected, 6)); 85 } catch (System.ArgumentException) { 61 } 62 catch (System.ArgumentException) { 86 63 exceptionFired = true; 87 64 }
Note: See TracChangeset
for help on using the changeset viewer.