public void do_nothing_to_a_link_that_is_authorized() { var tag = new HtmlTag("a").Authorized(true) .ReadOnlyIfNotAuthorized(); tag.Authorized().ShouldBeTrue(); tag.TagName().ShouldEqual("a"); }
public void change_an_unauthorized_link_to_a_span_and_authorize_the_span() { var tag = new HtmlTag("a").Authorized(false) .ReadOnlyIfNotAuthorized(); tag.Authorized().ShouldBeTrue(); tag.TagName().ShouldEqual("span"); }
public void do_nothing_to_a_div() { var tag = new HtmlTag("div").Authorized(false) .ReadOnlyIfNotAuthorized(); tag.Authorized().ShouldBeFalse(); tag.TagName().ShouldEqual("div"); }
public HtmlTag WrapWith(string tag) { var wrapper = new HtmlTag(tag); wrapper.Append(this); // Copies visibility and authorization from inner tag wrapper.Render(Render()); wrapper.Authorized(Authorized()); return(wrapper); }