- Timestamp:
- 10/23/16 19:31:18 (8 years ago)
- Location:
- trunk/sources/HeuristicLab.Tests/HeuristicLab.Encodings.PermutationEncoding-3.3
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Tests/HeuristicLab.Encodings.PermutationEncoding-3.3/CosaCrossoverTest.cs
r14185 r14353 20 20 #endregion 21 21 22 using HeuristicLab.Core; 22 23 using HeuristicLab.Tests; 23 24 using Microsoft.VisualStudio.TestTools.UnitTesting; … … 30 31 [TestClass()] 31 32 public class CosaCrossoverTest { 33 /// <summary> 34 ///A test for Cross 35 ///</summary> 36 [TestMethod] 37 [TestCategory("Encodings.Permutation")] 38 [TestProperty("Time", "short")] 39 public void CosaCrossoverCrossTest() { 40 TestRandom random = new TestRandom(); 41 var privateObject = new PrivateObject(typeof(CosaCrossover)); 42 // perform a test with more than two parents 43 random.Reset(); 44 bool exceptionFired = false; 45 try { 46 privateObject.Invoke("Cross", random, new ItemArray<Permutation>(new Permutation[] { 47 new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4)})); 48 } 49 catch (System.InvalidOperationException) { 50 exceptionFired = true; 51 } 52 Assert.IsTrue(exceptionFired); 53 } 54 32 55 /// <summary> 33 56 ///A test for Apply -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Encodings.PermutationEncoding-3.3/CyclicCrossover2Test.cs
r14185 r14353 20 20 #endregion 21 21 22 using HeuristicLab.Core; 22 23 using HeuristicLab.Tests; 23 24 using Microsoft.VisualStudio.TestTools.UnitTesting; … … 30 31 [TestClass()] 31 32 public class CyclicCrossover2Test { 33 /// <summary> 34 ///A test for Cross 35 ///</summary> 36 [TestMethod] 37 [TestCategory("Encodings.Permutation")] 38 [TestProperty("Time", "short")] 39 public void CyclicCrossover2CrossTest() { 40 TestRandom random = new TestRandom(); 41 var privateObject = new PrivateObject(typeof(CyclicCrossover2)); 42 // perform a test with more than two parents 43 random.Reset(); 44 bool exceptionFired = false; 45 try { 46 privateObject.Invoke("Cross", random, new ItemArray<Permutation>(new Permutation[] { 47 new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4)})); 48 } 49 catch (System.InvalidOperationException) { 50 exceptionFired = true; 51 } 52 Assert.IsTrue(exceptionFired); 53 } 54 32 55 /// <summary> 33 56 ///A test for Apply -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Encodings.PermutationEncoding-3.3/CyclicCrossoverTest.cs
r14185 r14353 20 20 #endregion 21 21 22 using HeuristicLab.Core; 22 23 using HeuristicLab.Tests; 23 24 using Microsoft.VisualStudio.TestTools.UnitTesting; … … 30 31 [TestClass()] 31 32 public class CyclicCrossoverTest { 33 /// <summary> 34 ///A test for Cross 35 ///</summary> 36 [TestMethod] 37 [TestCategory("Encodings.Permutation")] 38 [TestProperty("Time", "short")] 39 public void CyclicCrossoverCrossTest() { 40 TestRandom random = new TestRandom(); 41 var privateObject = new PrivateObject(typeof(CyclicCrossover)); 42 // perform a test with more than two parents 43 random.Reset(); 44 bool exceptionFired = false; 45 try { 46 privateObject.Invoke("Cross", random, new ItemArray<Permutation>(new Permutation[] { 47 new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4)})); 48 } 49 catch (System.InvalidOperationException) { 50 exceptionFired = true; 51 } 52 Assert.IsTrue(exceptionFired); 53 } 54 32 55 /// <summary> 33 56 ///A test for Apply -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Encodings.PermutationEncoding-3.3/EdgeRecombinationCrossoverTest.cs
r14185 r14353 20 20 #endregion 21 21 22 using HeuristicLab.Core; 22 23 using HeuristicLab.Tests; 23 24 using Microsoft.VisualStudio.TestTools.UnitTesting; … … 30 31 [TestClass()] 31 32 public class EdgeRecombinationCrossoverTest { 33 /// <summary> 34 ///A test for Cross 35 ///</summary> 36 [TestMethod] 37 [TestCategory("Encodings.Permutation")] 38 [TestProperty("Time", "short")] 39 public void EdgeRecombinationCrossoverCrossoverCrossTest() { 40 TestRandom random = new TestRandom(); 41 var privateObject = new PrivateObject(typeof(EdgeRecombinationCrossover)); 42 // perform a test with more than two parents 43 random.Reset(); 44 bool exceptionFired = false; 45 try { 46 privateObject.Invoke("Cross", random, new ItemArray<Permutation>(new Permutation[] { 47 new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4)})); 48 } 49 catch (System.InvalidOperationException) { 50 exceptionFired = true; 51 } 52 Assert.IsTrue(exceptionFired); 53 } 54 32 55 /// <summary> 33 56 ///A test for Apply -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Encodings.PermutationEncoding-3.3/MaximalPreservativeCrossoverTest.cs
r14185 r14353 20 20 #endregion 21 21 22 using HeuristicLab.Core; 22 23 using HeuristicLab.Tests; 23 24 using Microsoft.VisualStudio.TestTools.UnitTesting; … … 30 31 [TestClass()] 31 32 public class MaximalPreservativeCrossoverTest { 33 /// <summary> 34 ///A test for Cross 35 ///</summary> 36 [TestMethod] 37 [TestCategory("Encodings.Permutation")] 38 [TestProperty("Time", "short")] 39 public void MaximalPreservativeCrossoverCrossTest() { 40 TestRandom random = new TestRandom(); 41 var privateObject = new PrivateObject(typeof(MaximalPreservativeCrossover)); 42 // perform a test with more than two parents 43 random.Reset(); 44 bool exceptionFired = false; 45 try { 46 privateObject.Invoke("Cross", random, new ItemArray<Permutation>(new Permutation[] { 47 new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4)})); 48 } 49 catch (System.InvalidOperationException) { 50 exceptionFired = true; 51 } 52 Assert.IsTrue(exceptionFired); 53 } 54 32 55 /// <summary> 33 56 ///A test for Apply -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Encodings.PermutationEncoding-3.3/OrderBasedCrossoverTest.cs
r14185 r14353 20 20 #endregion 21 21 22 using HeuristicLab.Core; 22 23 using HeuristicLab.Tests; 23 24 using Microsoft.VisualStudio.TestTools.UnitTesting; … … 30 31 [TestClass()] 31 32 public class OrderBasedCrossoverTest { 33 /// <summary> 34 ///A test for Cross 35 ///</summary> 36 [TestMethod] 37 [TestCategory("Encodings.Permutation")] 38 [TestProperty("Time", "short")] 39 public void OrderBasedCrossoverCrossTest() { 40 TestRandom random = new TestRandom(); 41 var privateObject = new PrivateObject(typeof(OrderBasedCrossover)); 42 // perform a test with more than two parents 43 random.Reset(); 44 bool exceptionFired = false; 45 try { 46 privateObject.Invoke("Cross", random, new ItemArray<Permutation>(new Permutation[] { 47 new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4)})); 48 } 49 catch (System.InvalidOperationException) { 50 exceptionFired = true; 51 } 52 Assert.IsTrue(exceptionFired); 53 } 54 32 55 /// <summary> 33 56 ///A test for Apply -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Encodings.PermutationEncoding-3.3/OrderCrossover2Test.cs
r14185 r14353 20 20 #endregion 21 21 22 using HeuristicLab.Core; 22 23 using HeuristicLab.Tests; 23 24 using Microsoft.VisualStudio.TestTools.UnitTesting; … … 30 31 [TestClass()] 31 32 public class OrderCrossover2Test { 33 /// <summary> 34 ///A test for Cross 35 ///</summary> 36 [TestMethod] 37 [TestCategory("Encodings.Permutation")] 38 [TestProperty("Time", "short")] 39 public void OrderCrossover2CrossTest() { 40 TestRandom random = new TestRandom(); 41 var privateObject = new PrivateObject(typeof(OrderCrossover2)); 42 random.Reset(); 43 bool exceptionFired = false; 44 try { 45 privateObject.Invoke("Cross", random, new ItemArray<Permutation>(new Permutation[] { 46 new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4)})); 47 } 48 catch (System.InvalidOperationException) { 49 exceptionFired = true; 50 } 51 Assert.IsTrue(exceptionFired); 52 } 53 32 54 /// <summary> 33 55 ///A test for Apply -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Encodings.PermutationEncoding-3.3/OrderCrossoverTest.cs
r14185 r14353 20 20 #endregion 21 21 22 using HeuristicLab.Core; 22 23 using HeuristicLab.Tests; 23 24 using Microsoft.VisualStudio.TestTools.UnitTesting; … … 30 31 [TestClass()] 31 32 public class OrderCrossoverTest { 33 /// <summary> 34 ///A test for Cross 35 ///</summary> 36 [TestMethod] 37 [TestCategory("Encodings.Permutation")] 38 [TestProperty("Time", "short")] 39 public void OrderCrossoverCrossTest() { 40 TestRandom random = new TestRandom(); 41 var privateObject = new PrivateObject(typeof(OrderCrossover)); 42 // perform a test with more than two parents 43 random.Reset(); 44 bool exceptionFired = false; 45 try { 46 privateObject.Invoke("Cross", random, new ItemArray<Permutation>(new Permutation[] { 47 new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4)})); 48 } 49 catch (System.InvalidOperationException) { 50 exceptionFired = true; 51 } 52 Assert.IsTrue(exceptionFired); 53 } 54 32 55 /// <summary> 33 56 ///A test for Apply -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Encodings.PermutationEncoding-3.3/PartiallyMatchedCrossoverTest.cs
r14185 r14353 20 20 #endregion 21 21 22 using HeuristicLab.Core; 22 23 using HeuristicLab.Tests; 23 24 using Microsoft.VisualStudio.TestTools.UnitTesting; … … 30 31 [TestClass()] 31 32 public class PartiallyMatchedCrossoverTest { 33 /// <summary> 34 ///A test for Cross 35 ///</summary> 36 [TestMethod] 37 [TestCategory("Encodings.Permutation")] 38 [TestProperty("Time", "short")] 39 public void PartiallyMatchedCrossTest() { 40 TestRandom random = new TestRandom(); 41 var privateObject = new PrivateObject(typeof(PartiallyMatchedCrossover)); 42 // perform a test with more than two parents 43 random.Reset(); 44 bool exceptionFired = false; 45 try { 46 privateObject.Invoke("Cross", random, new ItemArray<Permutation>(new Permutation[] { 47 new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4)})); 48 } 49 catch (System.InvalidOperationException) { 50 exceptionFired = true; 51 } 52 Assert.IsTrue(exceptionFired); 53 } 54 32 55 /// <summary> 33 56 ///A test for Apply -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Encodings.PermutationEncoding-3.3/PositionBasedCrossoverTest.cs
r14185 r14353 20 20 #endregion 21 21 22 using HeuristicLab.Core; 22 23 using HeuristicLab.Tests; 23 24 using Microsoft.VisualStudio.TestTools.UnitTesting; … … 30 31 [TestClass()] 31 32 public class PositionBasedCrossoverTest { 33 /// <summary> 34 ///A test for Cross 35 ///</summary> 36 [TestMethod] 37 [TestCategory("Encodings.Permutation")] 38 [TestProperty("Time", "short")] 39 public void PositionBasedCrossoverCrossTest() { 40 TestRandom random = new TestRandom(); 41 var privateObject = new PrivateObject(typeof(PositionBasedCrossover)); 42 43 // perform a test with more than two parents 44 random.Reset(); 45 bool exceptionFired = false; 46 try { 47 privateObject.Invoke("Cross", random, new ItemArray<Permutation>(new Permutation[] { 48 new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4) })); 49 } 50 catch (System.InvalidOperationException) { 51 exceptionFired = true; 52 } 53 Assert.IsTrue(exceptionFired); 54 } 55 32 56 /// <summary> 33 57 ///A test for Apply -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Encodings.PermutationEncoding-3.3/UniformLikeCrossoverTest.cs
r14185 r14353 54 54 Assert.IsTrue(Auxiliary.PermutationIsEqualByPosition(expected, actual)); 55 55 } 56 57 /// <summary> 58 ///A test for Cross 59 ///</summary> 60 [TestMethod] 61 [TestCategory("Encodings.Permutation")] 62 [TestProperty("Time", "short")] 63 public void UniformLikeCrossoverCrossTest() { 64 var privateObject = new PrivateObject(typeof(UniformLikeCrossover)); 65 IRandom random = new TestRandom(new int[] { }, new double[] { 0.1, 0.2, 0.3, 0.4 }); 66 random.Reset(); 67 bool exceptionFired = false; 68 try { 69 privateObject.Invoke("Cross", random, new ItemArray<Permutation>(new Permutation[] { 70 71 new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4)})); 72 } 73 catch (System.InvalidOperationException) { 74 exceptionFired = true; 75 } 76 Assert.IsTrue(exceptionFired); 77 } 56 78 } 57 79 }
Note: See TracChangeset
for help on using the changeset viewer.