예제 #1
0
        public object Clone()
        {
            CloneableObject result = new CloneableObject();

            result.Value = Value;
            return(result);
        }
		public void CloneParametersCopiesValues()
		{
			CloneableObject obj = new CloneableObject();
			obj.Value = new object();

			CloneParameter cloneParam = new CloneParameter(new ValueParameter<CloneableObject>(obj));
			CloneableObject result = (CloneableObject) cloneParam.GetValue(null);

			Assert.AreSame(obj.Value, result.Value);
			Assert.AreSame(typeof (CloneableObject), cloneParam.GetParameterType(null));
		}
예제 #3
0
        public void CloneParametersCopiesValues()
        {
            CloneableObject obj = new CloneableObject();

            obj.Value = new object();

            CloneParameter  cloneParam = new CloneParameter(new ValueParameter <CloneableObject>(obj));
            CloneableObject result     = (CloneableObject)cloneParam.GetValue(null);

            Assert.AreSame(obj.Value, result.Value);
            Assert.AreSame(typeof(CloneableObject), cloneParam.GetParameterType(null));
        }
		public object Clone()
		{
			CloneableObject result = new CloneableObject();
			result.Value = Value;
			return result;
		}