当前位置: 首页>>代码示例>>C#>>正文


C# Script.ToString方法代码示例

本文整理汇总了C#中Script.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Script.ToString方法的具体用法?C# Script.ToString怎么用?C# Script.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Script的用法示例。


在下文中一共展示了Script.ToString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ErroneousScriptLoaderException

 public ErroneousScriptLoaderException(Script script, AstNode entity, ElfExceptionType reason)
     : base(reason)
 {
     Script = script;
     Entity = entity;
     Script.ToString();
 }
开发者ID:xeno-by,项目名称:elf4b,代码行数:7,代码来源:ErroneousScriptLoaderException.cs

示例2: ExpressionProducesLiterals

        public void ExpressionProducesLiterals()
        {
            var l = (IEnumerable<Expression>)new List<Expression> { 1, 2, 3.14, "Test", true, null };
            var s = new Script(l);

            Assert.AreEqual("1;2;3.14;\"Test\";true;;", s.ToString());
        }
开发者ID:DaveVdE,项目名称:adamjsgenerator,代码行数:7,代码来源:ExpressionTests.cs

示例3: ScriptProducesStatements

        public void ScriptProducesStatements()
        {
            var a = JS.Id("a");
            Script script1 = new Script
            {
                JS.Var(a),
                {
                    JS.For(a.AssignWith(3), a.IsGreaterThan(0), a.PreDecrement())
                        .Do(JS.Alert(a)),
                    JS.Return(a)
                }
            };

            Assert.AreEqual(3, script1.Statements.Count);
            Assert.AreEqual("var a;for(a=3;a>0;--a)alert(a);return a;", script1.ToString());

            Script script2 = new Script();

            script2.Add(script1);

            Assert.AreEqual("var a;for(a=3;a>0;--a)alert(a);return a;", script2.ToString());
        }
开发者ID:DaveVdE,项目名称:adamjsgenerator,代码行数:22,代码来源:ScriptTests.cs

示例4: Will_have_inline_content

 public void Will_have_inline_content()
 {
     var script = new Script("foo=bar");
     Assert.Contains(">foo=bar<", script.ToString());
 }
开发者ID:squadwuschel,项目名称:chutzpah,代码行数:5,代码来源:TestHarnessFacts.cs

示例5: Will_have_explicit_end_tag_and_no_content

 public void Will_have_explicit_end_tag_and_no_content()
 {
     var script = new Script(new ReferencedFile { Path = "file.js" });
     Assert.Contains("></script>", script.ToString());
 }
开发者ID:squadwuschel,项目名称:chutzpah,代码行数:5,代码来源:TestHarnessFacts.cs

示例6: OperatorAsFieldReference

 private CodeFieldReferenceExpression OperatorAsFieldReference(Script.Operator op)
 {
     var field = new CodeFieldReferenceExpression();
     field.TargetObject = new CodeTypeReferenceExpression(typeof(Script.Operator));
     field.FieldName = op.ToString();
     field.UserData.Add(RawData, op);
     return field;
 }
开发者ID:Tyelpion,项目名称:IronAHK,代码行数:8,代码来源:Operators.cs

示例7: When_Getting_ToString_With_Script_Then_Script_Is_Wrapped_In_Xhtml_Compliant_Comments

 public void When_Getting_ToString_With_Script_Then_Script_Is_Wrapped_In_Xhtml_Compliant_Comments()
 {
     var el = new Script {Code = "goose"};
     Assert.That(el.ToString(), Text.Contains("/*<![CDATA[*/\r\ngoose\r\n//]]>"));
 }
开发者ID:JonKruger,项目名称:MvcContrib,代码行数:5,代码来源:ScriptElementTester.cs

示例8: When_Getting_ToString_Then_Tag_Is_Generated

 public void When_Getting_ToString_Then_Tag_Is_Generated()
 {
     var el = new Script();
     Assert.That(el.ToString(), Text.Contains("<script"));
     Assert.That(el.ToString(), Text.Contains("</script>"));
 }
开发者ID:JonKruger,项目名称:MvcContrib,代码行数:6,代码来源:ScriptElementTester.cs


注:本文中的Script.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。