src/GenFx.Components.Tests/TreeEntityBaseTest.cs
/// <summary>
/// Tests that an exception is thrown when a null entity is passed.
/// </summary>
Tests that an exception is thrown when a null entity is passed.
Tests that an exception is thrown when a null entity is passed .
[Fact]
        public void TreeEntityBase_CopyToNullEntity()
        {
            MockGeneticAlgorithm algorithm = new MockGeneticAlgorithm
            {
                PopulationSeed = new MockPopulation(),
                SelectionOperator = new MockSelectionOperator(),
                FitnessEvaluator = new MockFitnessEvaluator(),
                GeneticEntitySeed = new TestTreeEntity()
            };
            TestTreeEntity entity = new TestTreeEntity();
            entity.Initialize(algorithm);
            Assert.Throws<ArgumentNullException>(() => entity.CopyTo(null));
        }
[ Fact ] public void TreeEntityBase_CopyToNullEntity ( ) { MockGeneticAlgorithm algorithm = new MockGeneticAlgorithm { PopulationSeed = new MockPopulation ( ) , SelectionOperator = new MockSelectionOperator ( ) , FitnessEvaluator = new MockFitnessEvaluator ( ) , GeneticEntitySeed = new TestTreeEntity ( ) } ; TestTreeEntity entity = new TestTreeEntity ( ) ; entity . Initialize ( algorithm ) ; Assert . Throws < ArgumentNullException > ( ( ) => entity . CopyTo ( null ) ) ; }
Tests that an exception is thrown when a null entity is passed.
Tests that an exception is thrown when a null entity is passed .