- Timestamp:
- 07/22/10 00:44:01 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/CosaCrossoverTest.cs
r3376 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 22 using HeuristicLab.Core; 23 using HeuristicLab.Encodings.PermutationEncoding; 24 24 using Microsoft.VisualStudio.TestTools.UnitTesting; 25 using HeuristicLab.Encodings.PermutationEncoding;26 25 27 26 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { 28 29 30 31 27 /// <summary> 28 ///This is a test class for CosaCrossoverTest and is intended 29 ///to contain all CosaCrossoverTest Unit Tests 30 ///</summary> 32 31 [TestClass()] 33 32 public class CosaCrossoverTest { … … 87 86 public void CosaCrossoverCrossTest() { 88 87 TestRandom random = new TestRandom(); 89 CosaCrossover_Accessor target = 88 CosaCrossover_Accessor target = 90 89 new CosaCrossover_Accessor(new PrivateObject(typeof(CosaCrossover))); 91 90 // perform a test with more than two parents … … 95 94 target.Cross(random, new ItemArray<Permutation>(new Permutation[] { 96 95 new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4)})); 97 } catch (System.InvalidOperationException) { 96 } 97 catch (System.InvalidOperationException) { 98 98 exceptionFired = true; 99 99 } … … 144 144 Assert.IsTrue(actual.Validate()); 145 145 Assert.IsTrue(Auxiliary.PermutationIsEqualByPosition(expected, actual)); 146 146 147 147 // perform a test when the two permutations are of unequal length 148 148 random.Reset(); … … 150 150 try { 151 151 CosaCrossover.Apply(random, new Permutation(PermutationTypes.RelativeUndirected, 8), new Permutation(PermutationTypes.RelativeUndirected, 6)); 152 } catch (System.ArgumentException) { 152 } 153 catch (System.ArgumentException) { 153 154 exceptionFired = true; 154 155 } -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/CyclicCrossover2Test.cs
r3742 r4068 21 21 22 22 using HeuristicLab.Core; 23 using HeuristicLab.Encodings.PermutationEncoding; 23 24 using Microsoft.VisualStudio.TestTools.UnitTesting; 24 using HeuristicLab.Encodings.PermutationEncoding;25 25 26 26 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { 27 28 29 30 27 /// <summary> 28 ///This is a test class for CyclicCrossover2Test and is intended 29 ///to contain all CyclicCrossover2Test Unit Tests 30 ///</summary> 31 31 [TestClass()] 32 32 public class CyclicCrossover2Test { … … 93 93 target.Cross(random, new ItemArray<Permutation>(new Permutation[] { 94 94 new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4)})); 95 } catch (System.InvalidOperationException) { 95 } 96 catch (System.InvalidOperationException) { 96 97 exceptionFired = true; 97 98 } … … 124 125 try { 125 126 CyclicCrossover.Apply(random, new Permutation(PermutationTypes.RelativeUndirected, 8), new Permutation(PermutationTypes.RelativeUndirected, 6)); 126 } catch (System.ArgumentException) { 127 } 128 catch (System.ArgumentException) { 127 129 exceptionFired = true; 128 130 } -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/CyclicCrossoverTest.cs
r3376 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 22 using HeuristicLab.Core; 23 using HeuristicLab.Encodings.PermutationEncoding; 24 24 using Microsoft.VisualStudio.TestTools.UnitTesting; 25 using HeuristicLab.Encodings.PermutationEncoding;26 25 27 26 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/EdgeRecombinationCrossoverTest.cs
r3376 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 22 using HeuristicLab.Core; 23 using HeuristicLab.Encodings.PermutationEncoding; 24 24 using Microsoft.VisualStudio.TestTools.UnitTesting; 25 using HeuristicLab.Encodings.PermutationEncoding;26 25 27 26 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { … … 122 121 Assert.IsTrue(actual.Validate()); 123 122 Assert.IsTrue(Auxiliary.PermutationIsEqualByPosition(expected, actual)); 124 123 125 124 // perform a test when the two permutations are of unequal length 126 125 random.Reset(); -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/InsertionManipulatorTest.cs
r3231 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Encodings.PermutationEncoding; 22 23 using Microsoft.VisualStudio.TestTools.UnitTesting; 23 using HeuristicLab.Encodings.PermutationEncoding;24 24 25 25 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { … … 90 90 parent = new Permutation(PermutationTypes.RelativeUndirected, new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }); 91 91 Assert.IsTrue(parent.Validate()); 92 92 93 93 expected = new Permutation(PermutationTypes.RelativeUndirected, new int[] { 0, 1, 2, 4, 5, 6, 3, 7 }); 94 94 Assert.IsTrue(expected.Validate()); -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/InversionManipulatorTest.cs
r3231 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Encodings.PermutationEncoding; 22 23 using Microsoft.VisualStudio.TestTools.UnitTesting; 23 using HeuristicLab.Encodings.PermutationEncoding;24 24 25 25 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { … … 90 90 parent = new Permutation(PermutationTypes.RelativeUndirected, new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 }); 91 91 Assert.IsTrue(parent.Validate()); 92 92 93 93 expected = new Permutation(PermutationTypes.RelativeUndirected, new int[] { 0, 4, 3, 2, 1, 5, 6, 7, 8 }); 94 94 Assert.IsTrue(expected.Validate()); -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/MaximalPreservativeCrossoverTest.cs
r3376 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 22 using HeuristicLab.Core; 23 using HeuristicLab.Encodings.PermutationEncoding; 24 24 using Microsoft.VisualStudio.TestTools.UnitTesting; 25 using HeuristicLab.Encodings.PermutationEncoding;26 25 27 26 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { … … 121 120 Assert.IsTrue(actual.Validate()); 122 121 Assert.IsTrue(Auxiliary.PermutationIsEqualByPosition(expected, actual)); 123 122 124 123 // perform a test when the two permutations are of unequal length 125 124 random.Reset(); -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/OrderBasedCrossoverTest.cs
r3376 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 22 using HeuristicLab.Core; 23 using HeuristicLab.Encodings.PermutationEncoding; 24 24 using Microsoft.VisualStudio.TestTools.UnitTesting; 25 using HeuristicLab.Encodings.PermutationEncoding;26 25 27 26 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { 28 29 30 31 27 /// <summary> 28 ///This is a test class for OrderBasedCrossoverTest and is intended 29 ///to contain all OrderBasedCrossoverTest Unit Tests 30 ///</summary> 32 31 [TestClass()] 33 32 public class OrderBasedCrossoverTest { … … 87 86 public void OrderBasedCrossoverCrossTest() { 88 87 TestRandom random = new TestRandom(); 89 OrderBasedCrossover_Accessor target = 88 OrderBasedCrossover_Accessor target = 90 89 new OrderBasedCrossover_Accessor(new PrivateObject(typeof(OrderBasedCrossover))); 91 90 // perform a test with more than two parents … … 95 94 target.Cross(random, new ItemArray<Permutation>(new Permutation[] { 96 95 new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4)})); 97 } catch (System.InvalidOperationException) { 96 } 97 catch (System.InvalidOperationException) { 98 98 exceptionFired = true; 99 99 } … … 124 124 try { 125 125 OrderBasedCrossover.Apply(random, new Permutation(PermutationTypes.RelativeUndirected, 8), new Permutation(PermutationTypes.RelativeUndirected, 6)); 126 } catch (System.ArgumentException) { 126 } 127 catch (System.ArgumentException) { 127 128 exceptionFired = true; 128 129 } -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/OrderCrossover2Test.cs
r3742 r4068 21 21 22 22 using HeuristicLab.Core; 23 using HeuristicLab.Encodings.PermutationEncoding; 23 24 using Microsoft.VisualStudio.TestTools.UnitTesting; 24 using HeuristicLab.Encodings.PermutationEncoding;25 25 26 26 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { 27 28 29 30 27 /// <summary> 28 ///This is a test class for OrderCrossover2Test and is intended 29 ///to contain all OrderCrossover2Test Unit Tests 30 ///</summary> 31 31 [TestClass()] 32 32 public class OrderCrossover2Test { … … 92 92 target.Cross(random, new ItemArray<Permutation>(new Permutation[] { 93 93 new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4)})); 94 } catch (System.InvalidOperationException) { 94 } 95 catch (System.InvalidOperationException) { 95 96 exceptionFired = true; 96 97 } … … 123 124 try { 124 125 OrderCrossover.Apply(random, new Permutation(PermutationTypes.RelativeUndirected, 8), new Permutation(PermutationTypes.RelativeUndirected, 6)); 125 } catch (System.ArgumentException) { 126 } 127 catch (System.ArgumentException) { 126 128 exceptionFired = true; 127 129 } -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/OrderCrossoverTest.cs
r3376 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 22 using HeuristicLab.Core; 23 using HeuristicLab.Encodings.PermutationEncoding; 24 24 using Microsoft.VisualStudio.TestTools.UnitTesting; 25 using HeuristicLab.Encodings.PermutationEncoding;26 25 27 26 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { 28 29 30 31 27 /// <summary> 28 ///This is a test class for OrderCrossoverTest and is intended 29 ///to contain all OrderCrossoverTest Unit Tests 30 ///</summary> 32 31 [TestClass()] 33 32 public class OrderCrossoverTest { … … 87 86 public void OrderCrossoverCrossTest() { 88 87 TestRandom random = new TestRandom(); 89 OrderCrossover_Accessor target = 88 OrderCrossover_Accessor target = 90 89 new OrderCrossover_Accessor(new PrivateObject(typeof(OrderCrossover))); 91 90 // perform a test with more than two parents … … 95 94 target.Cross(random, new ItemArray<Permutation>(new Permutation[] { 96 95 new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4)})); 97 } catch (System.InvalidOperationException) { 96 } 97 catch (System.InvalidOperationException) { 98 98 exceptionFired = true; 99 99 } … … 177 177 try { 178 178 OrderCrossover.Apply(random, new Permutation(PermutationTypes.RelativeUndirected, 8), new Permutation(PermutationTypes.RelativeUndirected, 6)); 179 } catch (System.ArgumentException) { 179 } 180 catch (System.ArgumentException) { 180 181 exceptionFired = true; 181 182 } -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/PartiallyMatchedCrossoverTest.cs
r3376 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 22 using HeuristicLab.Core; 23 using HeuristicLab.Encodings.PermutationEncoding; 24 24 using Microsoft.VisualStudio.TestTools.UnitTesting; 25 using HeuristicLab.Encodings.PermutationEncoding;26 25 27 26 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/PositionBasedCrossoverTest.cs
r3376 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 22 using HeuristicLab.Core; 23 using HeuristicLab.Encodings.PermutationEncoding; 24 24 using Microsoft.VisualStudio.TestTools.UnitTesting; 25 using HeuristicLab.Encodings.PermutationEncoding;26 25 27 26 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { … … 89 88 PositionBasedCrossover_Accessor target = new PositionBasedCrossover_Accessor( 90 89 new PrivateObject(typeof(PositionBasedCrossover))); 91 90 92 91 // perform a test with more than two parents 93 92 random.Reset(); … … 131 130 try { 132 131 PositionBasedCrossover.Apply(random, new Permutation(PermutationTypes.RelativeUndirected, 8), new Permutation(PermutationTypes.RelativeUndirected, 6)); 133 } catch (System.ArgumentException) { 132 } 133 catch (System.ArgumentException) { 134 134 exceptionFired = true; 135 135 } -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/ScrambleManipulatorTest.cs
r3231 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Encodings.PermutationEncoding; 22 23 using Microsoft.VisualStudio.TestTools.UnitTesting; 23 using HeuristicLab.Encodings.PermutationEncoding;24 24 25 25 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { … … 90 90 parent = new Permutation(PermutationTypes.RelativeUndirected, new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }); 91 91 Assert.IsTrue(parent.Validate()); 92 92 93 93 expected = new Permutation(PermutationTypes.RelativeUndirected, new int[] { 0, 1, 2, 4, 5, 6, 3, 7 }); 94 94 Assert.IsTrue(expected.Validate()); -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/Swap2ManipulatorTest.cs
r3231 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Encodings.PermutationEncoding; 22 23 using Microsoft.VisualStudio.TestTools.UnitTesting; 23 using HeuristicLab.Encodings.PermutationEncoding;24 24 25 25 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/Swap3ManipulatorTest.cs
r3231 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Encodings.PermutationEncoding; 22 23 using Microsoft.VisualStudio.TestTools.UnitTesting; 23 using HeuristicLab.Encodings.PermutationEncoding;24 24 25 25 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/TranslocationInversionManipulatorTest.cs
r3231 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Encodings.PermutationEncoding; 22 23 using Microsoft.VisualStudio.TestTools.UnitTesting; 23 using HeuristicLab.Encodings.PermutationEncoding;24 24 25 25 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { … … 90 90 parent = new Permutation(PermutationTypes.RelativeUndirected, new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }); 91 91 Assert.IsTrue(parent.Validate()); 92 92 93 93 expected = new Permutation(PermutationTypes.RelativeUndirected, new int[] { 0, 1, 5, 6, 4, 3, 2, 7 }); 94 94 Assert.IsTrue(expected.Validate()); -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/TranslocationManipulatorTest.cs
r3231 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Encodings.PermutationEncoding; 22 23 using Microsoft.VisualStudio.TestTools.UnitTesting; 23 using HeuristicLab.Encodings.PermutationEncoding;24 24 25 25 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { … … 90 90 parent = new Permutation(PermutationTypes.RelativeUndirected, new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }); 91 91 Assert.IsTrue(parent.Validate()); 92 92 93 93 expected = new Permutation(PermutationTypes.RelativeUndirected, new int[] { 0, 1, 5, 6, 2, 3, 4, 7 }); 94 94 Assert.IsTrue(expected.Validate());
Note: See TracChangeset
for help on using the changeset viewer.