/// <summary> /// Returns deep clone of parameter. /// </summary> public DotNetParameter Clone() { DotNetQualifiedTypeName clonedTypeName = null; if (TypeName != null) { clonedTypeName = TypeName.Clone(); } return(new DotNetParameter(clonedTypeName, Category)); }
public void TypeNameClone() { TypeName tn = new TypeName() { Namespace = "SurveyEngine.DataTypeConverters", Name = "CalendarQuestionConstraintType", Assembly = "SurveyEngine.DataTypeConverters", Version = new Version("2.3.5.2"), Culture = "neutral", PublicKeyToken = "79cd5921ea88a364" }; TypeName clone = tn.Clone(); Assert.IsFalse(object.ReferenceEquals(tn, clone)); Assert.AreEqual(tn.Assembly, clone.Assembly); Assert.AreEqual(tn.Culture, clone.Culture); Assert.AreEqual(tn.Name, clone.Name); Assert.AreEqual(tn.Namespace, clone.Namespace); Assert.AreEqual(tn.PublicKeyToken, clone.PublicKeyToken); Assert.AreEqual(tn.Version, clone.Version); }