Exemplo n.º 1
0
        public void TestCodeArgumentReferenceExpression()
        {
            var e       = new CodeArgumentReferenceExpression("myParameterName");
            var builder = new StringBuilder();
            var o       = new CodeGeneratorOptions()
            {
                IndentString = "    "
            };

            using (var w = new StringWriter(builder))
            {
                var provider = new TypeScriptCodeProvider();
                provider.GenerateCodeFromExpression(e, w, o);
            }
            Assert.Equal("myParameterName", builder.ToString());
        }
Exemplo n.º 2
0
        static void TestCodeExpression(CodeExpression e, string expected)
        {
            var builder = new StringBuilder();
            var o       = new CodeGeneratorOptions()
            {
                IndentString = "    "
            };

            using (var w = new StringWriter(builder))
            {
                var provider = new TypeScriptCodeProvider();
                provider.GenerateCodeFromExpression(e, w, o);
            }
            var s = builder.ToString();

            Assert.Equal(expected, s);
        }