src/GenFx.Components.Tests/VariableSinglePointCrossoverOperatorTest.cs
/// <summary>
/// Tests that the <see cref="VariableSinglePointCrossoverOperator.GenerateCrossover"/> method works correctly.
/// </summary>
Tests that the  method works correctly.
Tests that the method works correctly .
[Fact]
        public void VariableSinglePointCrossoverOperator_GenerateCrossover()
        {
            VariableSinglePointCrossoverOperator op = new VariableSinglePointCrossoverOperator();
            PrivateObject accessor = new PrivateObject(op);
            RandomNumberService.Instance = new FakeRandomNumberService(
                new Queue<int>(new int[] { 5, 3 }),
                new Queue<int>(new int[] { 3, 2 }));
            List<GeneticEntity> entities = new List<GeneticEntity>
            {
                new TestEntity<int>(1, 2, 3, 4, 5),
                new TestEntity<int>(4, 1, 7)
            };
            IEnumerable<TestEntity<int>> result = 
                ((IEnumerable<GeneticEntity>)accessor.Invoke("GenerateCrossover", entities))
                .Cast<TestEntity<int>>();
            Assert.Equal(2, result.Count());
            Assert.Equal(
                new int[] { 1, 2, 3, 7 }, result.ElementAt(0).InnerList);
            Assert.Equal(
                new int[] { 4, 1, 4, 5 }, result.ElementAt(1).InnerList);
        }
[ Fact ] public void VariableSinglePointCrossoverOperator_GenerateCrossover ( ) { VariableSinglePointCrossoverOperator op = new VariableSinglePointCrossoverOperator ( ) ; PrivateObject accessor = new PrivateObject ( op ) ; RandomNumberService . Instance = new FakeRandomNumberService ( new Queue < int > ( new int [ ] { 5 , 3 } ) , new Queue < int > ( new int [ ] { 3 , 2 } ) ) ; List < GeneticEntity > entities = new List < GeneticEntity > { new TestEntity < int > ( 1 , 2 , 3 , 4 , 5 ) , new TestEntity < int > ( 4 , 1 , 7 ) } ; IEnumerable < TestEntity < int > > result = ( ( IEnumerable < GeneticEntity > ) accessor . Invoke ( " " , entities ) ) . Cast < TestEntity < int > > ( ) ; Assert . Equal ( 2 , result . Count ( ) ) ; Assert . Equal ( new int [ ] { 1 , 2 , 3 , 7 } , result . ElementAt ( 0 ) . InnerList ) ; Assert . Equal ( new int [ ] { 4 , 1 , 4 , 5 } , result . ElementAt ( 1 ) . InnerList ) ; }
Tests that the  method works correctly.
Tests that the method works correctly .