src/GenFx.Components.Tests/BinaryStringEntityTest.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 BinaryStringEntity_Serialization()
        {
            BinaryStringEntity entity = new BinaryStringEntity();
            entity.MinimumStartingLength = entity.MaximumStartingLength = 3;
            entity.IsFixedSize = true;
            entity.Initialize(new MockGeneticAlgorithm());
            BinaryStringEntity result = (BinaryStringEntity)SerializationHelper.TestSerialization(
                entity, new Type[] { typeof(MockGeneticAlgorithm), typeof(DefaultTerminator) });
            for (int i = 0; i < 3; i++)
            {
                Assert.Equal(entity[i], result[i]);
            }
            Assert.True(result.IsFixedSize);
        }
[ Fact ] public void BinaryStringEntity_Serialization ( ) { BinaryStringEntity entity = new BinaryStringEntity ( ) ; entity . MinimumStartingLength = entity . MaximumStartingLength = 3 ; entity . IsFixedSize = true ; entity . Initialize ( new MockGeneticAlgorithm ( ) ) ; BinaryStringEntity result = ( BinaryStringEntity ) SerializationHelper . TestSerialization ( entity , new Type [ ] { typeof ( MockGeneticAlgorithm ) , typeof ( DefaultTerminator ) } ) ; for ( int i = 0 ; i < 3 ; i ++ ) { Assert . Equal ( entity [ i ] , result [ i ] ) ; } Assert . True ( result . IsFixedSize ) ; }
Tests that the component can be serialized and deserialized.
Tests that the component can be serialized and deserialized .