Changeset 13235 for trunk/sources/HeuristicLab.Tests/HeuristicLab.Encodings.PermutationEncoding-3.3/OrderBasedCrossoverTest.cs
- Timestamp:
- 11/17/15 19:45:30 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Tests/HeuristicLab.Encodings.PermutationEncoding-3.3/OrderBasedCrossoverTest.cs
r12012 r13235 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 OrderBasedCrossoverTest { 33 /// <summary>34 ///A test for Cross35 ///</summary>36 [TestMethod]37 [TestCategory("Encodings.Permutation")]38 [TestProperty("Time", "short")]39 public void OrderBasedCrossoverCrossTest() {40 TestRandom random = new TestRandom();41 OrderBasedCrossover_Accessor target =42 new OrderBasedCrossover_Accessor(new PrivateObject(typeof(OrderBasedCrossover)));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 … … 78 55 try { 79 56 OrderBasedCrossover.Apply(random, new Permutation(PermutationTypes.RelativeUndirected, 8), new Permutation(PermutationTypes.RelativeUndirected, 6)); 80 } catch (System.ArgumentException) { 57 } 58 catch (System.ArgumentException) { 81 59 exceptionFired = true; 82 60 }
Note: See TracChangeset
for help on using the changeset viewer.