src/GenFx.Components.Tests/ListEntityTests.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 ListEntity_Serialization()
        {
            TestListEntity<string> entity = new TestListEntity<string>
            {
                IsFixedSize = true
            };
            PrivateObject privObj = new PrivateObject(entity, new PrivateType(typeof(ListEntity<string>)));
            List<string> genes = new List<string> { "a", "b" };
            privObj.SetField("genes", genes);
            ListEntity<string> result = (ListEntity<string>)SerializationHelper.TestSerialization(entity, new Type[0]);
            Assert.Equal(entity.IsFixedSize, result.IsFixedSize);
            PrivateObject resultPrivObj = new PrivateObject(result, new PrivateType(typeof(ListEntity<string>)));
            List<string> resultGenes = (List<string>)resultPrivObj.GetField("genes");
            Assert.Equal(genes[0], resultGenes[0]);
            Assert.Equal(genes[1], resultGenes[1]);
        }
[ Fact ] public void ListEntity_Serialization ( ) { TestListEntity < string > entity = new TestListEntity < string > { IsFixedSize = true } ; PrivateObject privObj = new PrivateObject ( entity , new PrivateType ( typeof ( ListEntity < string > ) ) ) ; List < string > genes = new List < string > { " " , " " } ; privObj . SetField ( " " , genes ) ; ListEntity < string > result = ( ListEntity < string > ) SerializationHelper . TestSerialization ( entity , new Type [ 0 ] ) ; Assert . Equal ( entity . IsFixedSize , result . IsFixedSize ) ; PrivateObject resultPrivObj = new PrivateObject ( result , new PrivateType ( typeof ( ListEntity < string > ) ) ) ; List < string > resultGenes = ( List < string > ) resultPrivObj . GetField ( " " ) ; Assert . Equal ( genes [ 0 ] , resultGenes [ 0 ] ) ; Assert . Equal ( genes [ 1 ] , resultGenes [ 1 ] ) ; }
Tests that the object can be serialized and deserialized.
Tests that the object can be serialized and deserialized .