src/GenFx.Tests/GeneticEnvironmentTest.cs
/// <summary>
/// Tests that the object can be serialized and deserialized.
/// </summary>
Tests that the object can be serialized and deserialized.
Tests that the object can be serialized and deserialized .
[Fact]
        public void GeneticEnvironment_Serialization()
        {
            GeneticEnvironment environment = new GeneticEnvironment(new MockGeneticAlgorithm());
            environment.Populations.Add(new MockPopulation());
            GeneticEnvironment result = (GeneticEnvironment)SerializationHelper.TestSerialization(environment, new Type[]
            {
                typeof(MockGeneticAlgorithm),
                typeof(MockPopulation),
                typeof(DefaultTerminator)
            });
            Assert.IsType<MockPopulation>(result.Populations[0]);
            PrivateObject privObj = new PrivateObject(environment);
            Assert.IsType<MockGeneticAlgorithm>(privObj.GetField("algorithm"));
        }
[ Fact ] public void GeneticEnvironment_Serialization ( ) { GeneticEnvironment environment = new GeneticEnvironment ( new MockGeneticAlgorithm ( ) ) ; environment . Populations . Add ( new MockPopulation ( ) ) ; GeneticEnvironment result = ( GeneticEnvironment ) SerializationHelper . TestSerialization ( environment , new Type [ ] { typeof ( MockGeneticAlgorithm ) , typeof ( MockPopulation ) , typeof ( DefaultTerminator ) } ) ; Assert . IsType < MockPopulation > ( result . Populations [ 0 ] ) ; PrivateObject privObj = new PrivateObject ( environment ) ; Assert . IsType < MockGeneticAlgorithm > ( privObj . GetField ( " " ) ) ; }
Tests that the object can be serialized and deserialized.
Tests that the object can be serialized and deserialized .