public void ClonesParameters() { var method = new CodeMethod { Name = "method1" }; method.AddParameter(new CodeParameter { Name = "param1" }); var clone = method.Clone() as CodeMethod; Assert.Equal(method.Name, clone.Name); Assert.Single(method.Parameters); Assert.Equal(method.Parameters.First().Name, clone.Parameters.First().Name); }
public void ClonesParameters() { var root = CodeNamespace.InitRootNamespace(); var method = new CodeMethod(root) { Name = "method1" }; method.AddParameter(new CodeParameter(method) { Name = "param1" }); var clone = method.Clone() as CodeMethod; Assert.Equal(method.Name, clone.Name); Assert.Single(method.Parameters); Assert.Equal(method.Parameters.First().Name, clone.Parameters.First().Name); }