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);
        }
Beispiel #2
0
    public void DeepCopyThrowWhenCopyInstanceOfNonSerializableTypeAndErrorsDisabled()
    {
        var    nonSerializableInstance = new CustomNonSerializableType();
        object result = null;

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

        Assert.Throws <SerializationException>(() => nonSerializableInstance.DeepCopy(true));
    }
    public void DeepCopyThrowWhenCopyNonSerializableInstance()
    {
        var nonSerializableInstance = new CustomNonSerializableType();

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