public void ShouldReturnXhtmlRepresentationOfForm() { const string expectedXhtml = @"<div xmlns=""http://www.w3.org/1999/xhtml""> <form action=""/encounters/1"" method=""POST"" enctype=""application/x-www-form-urlencoded""> <input type=""text"" name=""field1"" value=""field1value"" /> <input type=""text"" name=""field2"" /> <input type=""text"" name=""field3"" value="""" /> <input type=""submit"" value=""Submit"" /> </form> </div>"; var writer = new FormWriter(new Uri("/encounters/1", UriKind.Relative), HttpMethod.Post, new TextInput("field1", "field1value"), new TextInput("field2"), new TextInput("field3", string.Empty)); Assert.AreEqual(expectedXhtml, writer.ToXhtml()); }
public EntryBuilder WithForm(FormWriter form) { entry.Content = SyndicationContent.CreateXhtmlContent(form.ToXhtml()); return this; }
public FeedBuilder WithForm(FormWriter form) { feed.ElementExtensions.Add(XmlReader.Create(new StringReader(form.ToXhtml()))); return this; }