public void NewChromosomeHasSameStructureAsExistingOne()
        {
            var chromosomeRef = new StretchChromosome(5, 2);
            var chromosome    = chromosomeRef.CreateNew();
            var positions     = chromosome.GetGenes().Select(g => (int)g.Value).ToArray();

            Assert.That(positions.Length, Is.EqualTo(2));
            Assert.That(positions[0], Is.Not.EqualTo(positions[1]));
            Assert.That(positions[0], Is.InRange(0, 4));
            Assert.That(positions[1], Is.InRange(0, 4));
        }
        public void RandomChromosomesEnsureThatWhenTryingEnoughNewChromosomeHasFullyDifferentGenes()
        {
            var chromosomeRef = new StretchChromosome(5, 2);
            var positionsRef  = chromosomeRef.GetGenes().Select(g => (int)g.Value).ToArray();

            for (;;)
            {
                var chromosome = chromosomeRef.CreateNew();
                var positions  = chromosome.GetGenes().Select(g => (int)g.Value).ToArray();
                if (positions[0] != positionsRef[0] && positions[1] != positionsRef[1])
                {
                    break;
                }
            }
        }