예제 #1
0
        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);
        }
예제 #2
0
        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);
        }