src/GenFx.Tests/GeneticEntityTest.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 GeneticEntity_Serialization()
        {
            MockEntity entity = new MockEntity
            {
                Age = 33,
                ScaledFitnessValue = 2
            };
            PrivateObject privObj = new PrivateObject(entity, new PrivateType(typeof(GeneticEntity)));
            privObj.SetField("rawFitnessValue", 7);
            MockEntity result = (MockEntity)SerializationHelper.TestSerialization(entity, new Type[0]);
            Assert.Equal(entity.Age, result.Age);
            Assert.Equal(entity.ScaledFitnessValue, result.ScaledFitnessValue);
            Assert.Equal(entity.RawFitnessValue, result.RawFitnessValue);
        }
[ Fact ] public void GeneticEntity_Serialization ( ) { MockEntity entity = new MockEntity { Age = 33 , ScaledFitnessValue = 2 } ; PrivateObject privObj = new PrivateObject ( entity , new PrivateType ( typeof ( GeneticEntity ) ) ) ; privObj . SetField ( " " , 7 ) ; MockEntity result = ( MockEntity ) SerializationHelper . TestSerialization ( entity , new Type [ 0 ] ) ; Assert . Equal ( entity . Age , result . Age ) ; Assert . Equal ( entity . ScaledFitnessValue , result . ScaledFitnessValue ) ; Assert . Equal ( entity . RawFitnessValue , result . RawFitnessValue ) ; }
Tests that the object can be serialized and deserialized.
Tests that the object can be serialized and deserialized .