src/GenFx.Components.Tests/BoltzmannSelectionOperatorTest.cs
/// <summary>
/// Tests that an exception is thrown when the calculation has an overflow.
/// </summary>
Tests that an exception is thrown when the calculation has an overflow.
Tests that an exception is thrown when the calculation has an overflow .
[Fact]
        public void BoltzmannSelectionOperator_Select_Overflow()
        {
            double initialTemp = .0000001;
            MockGeneticAlgorithm algorithm = GetMockAlgorithm(initialTemp);
            FakeBoltzmannSelectionOperator op = new FakeBoltzmannSelectionOperator();
            op.Initialize(algorithm);
            MockPopulation population = new MockPopulation();
            population.Initialize(algorithm);
            MockEntity entity = new MockEntity();
            entity.Initialize(algorithm);
            entity.ScaledFitnessValue = 1;
            population.Entities.Add(entity);
            Assert.Throws<OverflowException>(() => op.SelectEntities(1, population));
        }
[ Fact ] public void BoltzmannSelectionOperator_Select_Overflow ( ) { double initialTemp = .0000001 ; MockGeneticAlgorithm algorithm = GetMockAlgorithm ( initialTemp ) ; FakeBoltzmannSelectionOperator op = new FakeBoltzmannSelectionOperator ( ) ; op . Initialize ( algorithm ) ; MockPopulation population = new MockPopulation ( ) ; population . Initialize ( algorithm ) ; MockEntity entity = new MockEntity ( ) ; entity . Initialize ( algorithm ) ; entity . ScaledFitnessValue = 1 ; population . Entities . Add ( entity ) ; Assert . Throws < OverflowException > ( ( ) => op . SelectEntities ( 1 , population ) ) ; }
Tests that an exception is thrown when the calculation has an overflow.
Tests that an exception is thrown when the calculation has an overflow .