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()); }
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); }