ToScriptFragment() public method

public ToScriptFragment ( ) : String
return String
Beispiel #1
0
        public void CanImplicitlyConvertToString()
        {
            var scriptBlock = new ScriptBlock("function myFunction() { }");

            String script = scriptBlock;

            Assert.Equal(scriptBlock.ToScriptFragment(), script);
        }
Beispiel #2
0
        public void WrapScriptBlockWithScriptTag()
        {
            var scriptBlock = new ScriptBlock("function myFunction() { }");

            Assert.Equal(
              String.Format(ScriptResources.ScriptBlockFormat, "function myFunction() { }"),
              scriptBlock.ToScriptFragment()
            );
        }
Beispiel #3
0
        public void AppendBlock(ScriptBlock scriptBlock)
        {
            Verify.NotNull(scriptBlock, "scriptBlock");

            _script.AppendLine(scriptBlock.ToScriptFragment());
        }