public void CanImplicitlyConvertToString() { var scriptBlock = new ScriptBlock("function myFunction() { }"); String script = scriptBlock; Assert.Equal(scriptBlock.ToScriptFragment(), script); }
public void WrapScriptBlockWithScriptTag() { var scriptBlock = new ScriptBlock("function myFunction() { }"); Assert.Equal( String.Format(ScriptResources.ScriptBlockFormat, "function myFunction() { }"), scriptBlock.ToScriptFragment() ); }
public void AppendBlock(ScriptBlock scriptBlock) { Verify.NotNull(scriptBlock, "scriptBlock"); _script.AppendLine(scriptBlock.ToScriptFragment()); }