Exemple #1
0
        public void CompareDNA_ExpectedFitnessFromPairOfDNAComparison_ReturnsInt(int x, int y, int expected)
        {
            //arrange
            _DNA a = new _DNA(x);
            _DNA b = new _DNA(y);
            int  c;

            //act
            c = CompareDNAModified(a, b);

            //assert
            Assert.AreEqual(c, expected);
        }
Exemple #2
0
 /* Simplified CompareDNA method in order to reduce arrangement requirements */
 private int CompareDNAModified(_DNA a, _DNA b)
 {
     if (a.fitness > b.fitness)
     {
         return(-1);
     }
     else if (a.fitness < b.fitness)
     {
         return(1);
     }
     else
     {
         return(0);
     }
 }