public void non_html_methods_are_rendered_as_url_modifiers_when_the_uri_decorator_is_active()
        {
            DependencyManager.GetService <IDependencyResolver>().AddDependency <IUriDecorator, HttpMethodOverrideUriDecorator>();

            WhenCreatingElement(() => new FormElement(true).Action("http://localhost/test").Method("PUT"));

            ThenTheElementAsString.ShouldContain("method=\"POST\"");
            ThenTheElementAsString.ShouldContain("action=\"http://localhost/test!PUT");
        }
Example #2
0
        public void the_option_element_is_selected()
        {
            WhenCreatingElement(() => ((IXhtmlAnchor)null).Select(() => this.PropertyReturningFalse));

            ThenTheElement.ChildElements.OfType <IOptionElement>().Where(x => x.InnerText == "Interface").Single().Selected.ShouldBeTrue();
            ThenTheElement.ChildElements.OfType <IOptionElement>().Where(x => x.InnerText != "Interface").All(x => x.Selected.ShouldBeFalse());
            ThenTheElementAsString.Contains("<option value=\"Interface\" selected=\"selected\" />");
            ThenTheElementAsString.Contains("<option value=\"Method\" />");
        }
        public void multiple_media_types_in_accept_results_in_a_comma_separated_list()
        {
            WhenCreatingElement(() => new FormElement(false).Accept("text/html").Accept("application/xhtml+xml"));

            ThenTheElementAsString.ShouldContain("accept=\"text/html,application/xhtml+xml\"");
        }
Example #4
0
 public void the_values_are_encoded_according_to_the_html_specification()
 {
     WhenCreatingElement(() => new GenericElement("tag").Attr("name", "value & value2"));
     ThenTheElementAsString.ShouldContain("name=\"value &#38; value2\"", Case.Sensitive);
 }
 public void the_media_attribute_is_generated()
 {
     WhenCreatingElement(() => Document.CreateElement <IStyleElement>().Media("screen"));
     ThenTheElementAsString.ShouldContain(@"media=""screen""");
 }
 public void two_media_attributes_are_generated()
 {
     WhenCreatingElement(() => Document.CreateElement <IStyleElement>().Media("screen").Media("alternate"));
     ThenTheElementAsString.ShouldContain(@"media=""screen,alternate""");
 }
 public void the_content_is_written()
 {
     WhenCreatingElement(() => Document.CreateElement <ITextAreaElement>()["hello"]);
     ThenTheElementAsString.ShouldBe("<textarea>hello</textarea>");
 }
 public void the_media_is_not_defined_by_default()
 {
     WhenCreatingElement(Document.CreateElement <IStyleElement>);
     ThenTheElementAsString.ShouldNotContain("media=");
 }
Example #9
0
 public void the_scrolling_is_rendered_as_yes_when_the_yes_value_is_used()
 {
     WhenCreatingElement(() => Document.CreateElement <IIFrameElement>().Scrolling(Scrolling.Yes));
     ThenTheElementAsString.ShouldContain(@"scrolling=""yes""", Case.Sensitive);
 }
Example #10
0
 public void the_scrolling_is_not_rendered_by_default()
 {
     WhenCreatingElement(() => Document.CreateElement <IIFrameElement>());
     ThenTheElementAsString.ShouldNotContain("scrolling=");
 }
Example #11
0
 public void the_boreder_is_not_set_by_default()
 {
     WhenCreatingElement(() => Document.CreateElement <IIFrameElement>());
     ThenTheElementAsString.ShouldNotContain("frameborder=");
 }
Example #12
0
 public void the_border_is_set_to_1_when_the_attribute_value_is_true()
 {
     WhenCreatingElement(() => Document.CreateElement <IIFrameElement>().FrameBorder(true));
     ThenTheElementAsString.ShouldContain("frameborder=\"1\"", Case.Sensitive);
 }
 public void the_border_is_set_to_0_when_the_attribute_value_is_false()
 {
     WhenCreatingElement(() => Document.CreateElement <IIFrameElement>().FrameBorder(false));
     ThenTheElementAsString.ShouldContain("frameborder=\"0\"");
 }