public void TwoInstancesAreNotEqual() // refs #262 { var bundle1 = new InlineScriptBundle("var x = 1;"); var bundle2 = new InlineScriptBundle("var x = 1;"); bundle1.Equals(bundle2).ShouldBeFalse(); }
public void TwoInstancesAreNotEqual() { var bundle1 = new InlineScriptBundle("var x = 1;"); var bundle2 = new InlineScriptBundle("var x = 1;"); bundle1.Equals(bundle2).ShouldBeFalse(); }
public void GivenInlineScriptBundleWithScriptTagNoType_WhenRender_ThenScriptNotCreated() { var bundle = new InlineScriptBundle("<script>var x = 1;</script>"); var html = bundle.Render(); html.ShouldEqual( "<script>var x = 1;</script>" ); }
public void GivenInlineScriptBundleWithScriptTagAndAttributes_WhenRender_ThenScriptNotCreated() { var bundle = new InlineScriptBundle("<script type=\"text/javascript\">var x = 1;</script>"); bundle.HtmlAttributes.Add("class", "none"); var html = bundle.Render(); html.ShouldEqual( "<script class=\"none\" type=\"text/javascript\">var x = 1;</script>" ); }
public void GivenInlineScriptBundleWithContent_WhenRender_ThenScriptElementCreatedWithContent() { var bundle = new InlineScriptBundle("var x = 1;"); var html = bundle.Render(); html.ShouldEqual( "<script type=\"text/javascript\">" + Environment.NewLine + "var x = 1;" + Environment.NewLine + "</script>" ); }
public void GivenInlineScriptBundleHtmlAttributes_WhenRender_ThenScriptElementCreatedWithAttributes() { var bundle = new InlineScriptBundle("var x = 1;"); bundle.HtmlAttributes.Add("class", "none"); var html = bundle.Render(); html.ShouldEqual( "<script type=\"text/javascript\" class=\"none\">" + Environment.NewLine + "var x = 1;" + Environment.NewLine + "</script>" ); }
public void GivenInlineScriptBundleWithNotIECondition_WhenRender_ThenScriptElementHasConditionalCommentButLeavesScriptVisibleToAllBrowsers() { var bundle = new InlineScriptBundle("var x = 1;"); bundle.Condition = "(gt IE 9)| !IE"; var html = bundle.Render(); html.ShouldEqual( "<!--[if " + bundle.Condition + "]><!-->" + Environment.NewLine + "<script type=\"text/javascript\">" + Environment.NewLine + "var x = 1;" + Environment.NewLine + "</script>" + Environment.NewLine + "<!-- <![endif]-->" ); }
public void GivenInlineScriptBundleWithCondition_WhenRender_ThenScriptElementHasConditionalComment() { var bundle = new InlineScriptBundle("var x = 1;"); bundle.Condition = "IE"; var html = bundle.Render(); html.ShouldEqual( "<!--[if IE]>" + Environment.NewLine + "<script type=\"text/javascript\">" + Environment.NewLine + "var x = 1;" + Environment.NewLine + "</script>" + Environment.NewLine + "<![endif]-->" ); }
public void TheSameInstanceIsEqual() { var bundle1 = new InlineScriptBundle("var x = 1;"); bundle1.Equals(bundle1).ShouldBeTrue(); }