Changeset 13246 for stable/HeuristicLab.Tests/HeuristicLab.Encodings.PermutationEncoding-3.3/OrderCrossoverTest.cs
- Timestamp:
- 11/18/15 13:01:38 (8 years ago)
- Location:
- stable
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 13227,13235-13236
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Tests
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Tests merged: 13227,13235-13236
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Tests/HeuristicLab.Encodings.PermutationEncoding-3.3/OrderCrossoverTest.cs
r12009 r13246 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 OrderCrossoverTest { 33 /// <summary>34 ///A test for Cross35 ///</summary>36 [TestMethod]37 [TestCategory("Encodings.Permutation")]38 [TestProperty("Time", "short")]39 public void OrderCrossoverCrossTest() {40 TestRandom random = new TestRandom();41 OrderCrossover_Accessor target =42 new OrderCrossover_Accessor(new PrivateObject(typeof(OrderCrossover)));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 … … 131 108 try { 132 109 OrderCrossover.Apply(random, new Permutation(PermutationTypes.RelativeUndirected, 8), new Permutation(PermutationTypes.RelativeUndirected, 6)); 133 } catch (System.ArgumentException) { 110 } 111 catch (System.ArgumentException) { 134 112 exceptionFired = true; 135 113 }
Note: See TracChangeset
for help on using the changeset viewer.