示例#1
0
		public void SetHeadJsOnLoadedFunction_Should_Be_Added_To_Javascript()
		{
			// Arrange
			TextPluginStub plugin = new TextPluginStub();
			plugin.AddScript("pluginscript.js", "script1");
			plugin.SetHeadJsOnLoadedFunction("alert('done')");

			string expectedHtml = @"<script type=""text/javascript"">" +
								@"head.js({ ""script1"", ""pluginscript.js"" },function() { alert('done') })" +
								"</script>\n";

			// Act
			string actualHtml = plugin.GetJavascriptHtml();

			// Assert
			Assert.That(actualHtml, Is.EqualTo(expectedHtml), actualHtml);
		}
示例#2
0
		public void GetJavascriptHtml_Should_Contain_Scripts_With_HeadJs()
		{
			// Arrange
			TextPlugin plugin = new TextPluginStub();
			plugin.AddScript("pluginscript.js", "script1");
			string expectedHtml = @"<script type=""text/javascript"">" +
								@"head.js({ ""script1"", ""pluginscript.js"" },function() {  })" +
								"</script>\n";

			// Act
			string actualHtml = plugin.GetJavascriptHtml();

			// Assert
			Assert.That(actualHtml, Is.EqualTo(expectedHtml), actualHtml);
		}