Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/26/13 13:25:19 (11 years ago)
Author:
abeham
Message:

#2088: Added test attributes and cleaned up tests of the encodings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Encodings.RealVectorEncoding-3.3/SinglePointCrossoverTest.cs

    r9768 r9777  
    2121
    2222using HeuristicLab.Core;
    23 using HeuristicLab.Encodings.RealVectorEncoding;
    2423using HeuristicLab.Tests;
    2524using Microsoft.VisualStudio.TestTools.UnitTesting;
    2625
    2726namespace HeuristicLab.Encodings.RealVectorEncoding.Tests {
    28 
    29 
    3027  /// <summary>
    3128  ///This is a test class for SinglePointCrossoverTest and is intended
     
    3431  [TestClass()]
    3532  public class SinglePointCrossoverTest {
    36 
    37 
    38     private TestContext testContextInstance;
    39 
    40     /// <summary>
    41     ///Gets or sets the test context which provides
    42     ///information about and functionality for the current test run.
    43     ///</summary>
    44     public TestContext TestContext {
    45       get {
    46         return testContextInstance;
    47       }
    48       set {
    49         testContextInstance = value;
    50       }
    51     }
    52 
    53     #region Additional test attributes
    54     //
    55     //You can use the following additional attributes as you write your tests:
    56     //
    57     //Use ClassInitialize to run code before running the first test in the class
    58     //[ClassInitialize()]
    59     //public static void MyClassInitialize(TestContext testContext)
    60     //{
    61     //}
    62     //
    63     //Use ClassCleanup to run code after all tests in a class have run
    64     //[ClassCleanup()]
    65     //public static void MyClassCleanup()
    66     //{
    67     //}
    68     //
    69     //Use TestInitialize to run code before running each test
    70     //[TestInitialize()]
    71     //public void MyTestInitialize()
    72     //{
    73     //}
    74     //
    75     //Use TestCleanup to run code after each test has run
    76     //[TestCleanup()]
    77     //public void MyTestCleanup()
    78     //{
    79     //}
    80     //
    81     #endregion
    82 
    8333    /// <summary>
    8434    ///A test for Cross
    8535    ///</summary>
    86     [TestMethod]
    87     [DeploymentItem("HeuristicLab.Encodings.RealVectorEncoding-3.3.dll")]
     36    [TestMethod()]
     37    [TestCategory("Encodings.RealVector")]
     38    [TestProperty("Time", "short")]
    8839    public void SinglePointCrossoverCrossTest() {
    8940      SinglePointCrossover_Accessor target = new SinglePointCrossover_Accessor(new PrivateObject(typeof(SinglePointCrossover)));
     
    9849        RealVector actual;
    9950        actual = target.Cross(random, parents);
    100       }
    101       catch (System.ArgumentException) {
     51      } catch (System.ArgumentException) {
    10252        exceptionFired = true;
    10353      }
     
    11060        RealVector actual;
    11161        actual = target.Cross(random, parents);
    112       }
    113       catch (System.ArgumentException) {
     62      } catch (System.ArgumentException) {
    11463        exceptionFired = true;
    11564      }
     
    12271        RealVector actual;
    12372        actual = target.Cross(random, parents);
    124       }
    125       catch (System.ArgumentException) {
     73      } catch (System.ArgumentException) {
    12674        exceptionFired = true;
    12775      }
     
    13280    ///A test for Apply
    13381    ///</summary>
    134     [TestMethod]
     82    [TestMethod()]
     83    [TestCategory("Encodings.RealVector")]
     84    [TestProperty("Time", "short")]
    13585    public void SinglePointCrossoverApplyTest() {
    13686      TestRandom random = new TestRandom();
     
    153103      try {
    154104        actual = SinglePointCrossover.Apply(random, parent1, parent2);
    155       }
    156       catch (System.ArgumentException) {
     105      } catch (System.ArgumentException) {
    157106        exceptionFired = true;
    158107      }
     
    168117      // The following test is not based on published examples
    169118    }
    170 
    171     /// <summary>
    172     ///A test for SinglePointCrossover Constructor
    173     ///</summary>
    174     [TestMethod]
    175     public void SinglePointCrossoverConstructorTest() {
    176       SinglePointCrossover target = new SinglePointCrossover();
    177     }
    178119  }
    179120}
Note: See TracChangeset for help on using the changeset viewer.