示例#1
0
        public void CanCreateNonPublicInstanceWithNonPublicConstructor()
        {
            ConstructorNode ctorNode = new ConstructorNode();

            ctorNode.Text = typeof(PrivateTestClass).FullName;
            StringLiteralNode sNode = new StringLiteralNode();

            sNode.Text = "theValue3";
            ctorNode.addChild(sNode);
            IntLiteralNode iNode = new IntLiteralNode();

            iNode.Text = "3";
            ctorNode.addChild(iNode);

            PublicTestClass instance = (PublicTestClass)((IExpression)ctorNode).GetValue();

            Assert.AreEqual(sNode.Text, instance._s);
            Assert.AreEqual(3, instance._i);
        }