src/GenFx.Components.Tests/TimeDurationTerminatorTest.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 TimeDurationTerminator_Serialization()
        {
            TimeDurationTerminator terminator = new TimeDurationTerminator
            {
                TimeLimit = new TimeSpan(123)
            };
            PrivateObject privObj = new PrivateObject(terminator);
            DateTime now = DateTime.Now;
            privObj.SetField("timeStarted", now);
            TimeDurationTerminator result = (TimeDurationTerminator)SerializationHelper.TestSerialization(terminator, new Type[0]);
            Assert.Equal(terminator.TimeLimit, result.TimeLimit);
            PrivateObject resultPrivObj = new PrivateObject(result);
            Assert.Equal(now, resultPrivObj.GetField("timeStarted"));
        }
[ Fact ] public void TimeDurationTerminator_Serialization ( ) { TimeDurationTerminator terminator = new TimeDurationTerminator { TimeLimit = new TimeSpan ( 123 ) } ; PrivateObject privObj = new PrivateObject ( terminator ) ; DateTime now = DateTime . Now ; privObj . SetField ( " " , now ) ; TimeDurationTerminator result = ( TimeDurationTerminator ) SerializationHelper . TestSerialization ( terminator , new Type [ 0 ] ) ; Assert . Equal ( terminator . TimeLimit , result . TimeLimit ) ; PrivateObject resultPrivObj = new PrivateObject ( result ) ; Assert . Equal ( now , resultPrivObj . GetField ( " " ) ) ; }
Tests that the object can be serialized and deserialized.
Tests that the object can be serialized and deserialized .