src/GenFx.Components.Tests/BestMaximumFitnessTest.cs
/// <summary>
/// Tests that the component can be serialized and deserialized.
/// </summary>
Tests that the component can be serialized and deserialized.
Tests that the component can be serialized and deserialized .
[Fact]
        public void BestMaximumFitness_Serialization()
        {
            BestMaximumFitness metric = new BestMaximumFitness();
            PrivateObject privObj = new PrivateObject(metric);
            Dictionary<int, double> bestMaxValues = (Dictionary<int, double>)privObj.GetField("bestMaxValues");
            bestMaxValues.Add(10, 2.4);
            BestMaximumFitness result = (BestMaximumFitness)SerializationHelper.TestSerialization(metric, new Type[] { typeof(MockEntity) });
            PrivateObject resultPrivObj = new PrivateObject(result);
            Dictionary<int, double> resultBestMaxValues = (Dictionary<int, double>)resultPrivObj.GetField("bestMaxValues");
            Assert.Equal(2.4, resultBestMaxValues[10]);
        }
[ Fact ] public void BestMaximumFitness_Serialization ( ) { BestMaximumFitness metric = new BestMaximumFitness ( ) ; PrivateObject privObj = new PrivateObject ( metric ) ; Dictionary < int , double > bestMaxValues = ( Dictionary < int , double > ) privObj . GetField ( " " ) ; bestMaxValues . Add ( 10 , 2.4 ) ; BestMaximumFitness result = ( BestMaximumFitness ) SerializationHelper . TestSerialization ( metric , new Type [ ] { typeof ( MockEntity ) } ) ; PrivateObject resultPrivObj = new PrivateObject ( result ) ; Dictionary < int , double > resultBestMaxValues = ( Dictionary < int , double > ) resultPrivObj . GetField ( " " ) ; Assert . Equal ( 2.4 , resultBestMaxValues [ 10 ] ) ; }
Tests that the component can be serialized and deserialized.
Tests that the component can be serialized and deserialized .