예제 #1
0
        public void DeepCopy_Throws_Ex_When_Copy_Instance_Of_Non_Serializable_Type_And_Errors_Disabled()
        {
            var nonSerializableInstance = new CustomNonSerializableType();
            object result = null;

            Assert.DoesNotThrow(() => result = nonSerializableInstance.DeepCopy(false));
            Assert.Null(result);
        }
예제 #2
0
    public void DeepCopyThrowWhenCopyInstanceOfNonSerializableTypeAndErrorsDisabled()
    {
        var    nonSerializableInstance = new CustomNonSerializableType();
        object result = null;

        Assert.DoesNotThrow(() => result = nonSerializableInstance.DeepCopy(false));
        Assert.IsNull(result);
    }
예제 #3
0
 public void DeepCopy_Throws_Ex_When_Copy_Instance_Of_NonSerializable_Type()
 {
     var nonSerializableInstance = new CustomNonSerializableType();
     Assert.Throws<SerializationException>(() => nonSerializableInstance.DeepCopy(true));
 }
예제 #4
0
    public void DeepCopyThrowWhenCopyInstanceOfNonSerializableType()
    {
        var nonSerializableInstance = new CustomNonSerializableType();

        Assert.Throws <SerializationException>(() => nonSerializableInstance.DeepCopy(true));
    }