src/GenFx.Tests/ValidationExceptionTest.cs
/// <summary>
/// Tests that the exception can be serialized.
/// </summary>
Tests that the exception can be serialized.
Tests that the exception can be serialized .
[Fact]
        public void ValidationException_Serialization()
        {
            DataContractSerializer serializer = new DataContractSerializer(typeof(ValidationException));
            using (MemoryStream stream = new MemoryStream())
            {
                serializer.WriteObject(stream, new ValidationException("message"));
                stream.Position = 0;
                ValidationException deserialized = (ValidationException)serializer.ReadObject(stream);
                Assert.Equal("message", deserialized.Message);
            }
        }
[ Fact ] public void ValidationException_Serialization ( ) { DataContractSerializer serializer = new DataContractSerializer ( typeof ( ValidationException ) ) ; using ( MemoryStream stream = new MemoryStream ( ) ) { serializer . WriteObject ( stream , new ValidationException ( " " ) ) ; stream . Position = 0 ; ValidationException deserialized = ( ValidationException ) serializer . ReadObject ( stream ) ; Assert . Equal ( " " , deserialized . Message ) ; } }
Tests that the exception can be serialized.
Tests that the exception can be serialized .