Beispiel #1
0
 public void Then_Returns_ElementId_Tag_ClassName()
 {
     DomQuery query = new DomQueryBuilder().Id("goose").Descendant.Tag(HtmlTextWriterTag.P).Descendant.Class("chicken");
     Assert.That(query.ToString(), Is.EqualTo("#goose p .chicken"));
 }
Beispiel #2
0
 public void Then_Returns_PoundElementId()
 {
     DomQuery query = new DomQueryBuilder().Id("goose");
     Assert.That(query.ToString(), Is.EqualTo("#goose"));
 }
Beispiel #3
0
 public void Then_Returns_PoundElementId_Period_ClassName()
 {
     DomQuery query = new DomQueryBuilder().Id("goose").Class("chicken");
     Assert.That(query.ToString(), Is.EqualTo("#goose.chicken"));
 }
Beispiel #4
0
 public void When_No_Id_AddToList_Does_Nothing()
 {
     var dq = new DomQueryBuilder();
     var emptyQuery = new DomQuery("",true,new string[]{});
     Assert.That(dq.ToDomQuery().ToString(), Is.EqualTo(emptyQuery.ToString()));
 }
Beispiel #5
0
 public void Then_Returns_PeriodClassName()
 {
     DomQuery query = new DomQueryBuilder().Class("goose");
     Assert.That(query.ToString(), Is.EqualTo(".goose"));
 }
Beispiel #6
0
 public void Then_Returns_TagPoundElementId()
 {
     DomQuery query = new DomQueryBuilder().Tag(HtmlTextWriterTag.P).Id("goose");
     Assert.That(query.ToString(), Is.EqualTo("p#goose"));
 }
Beispiel #7
0
 public void Then_Returns_PoundElementId1_Comma_PoundElementId2()
 {
     DomQuery query = new DomQueryBuilder().Id("goose").And.Id("chicken");
     Assert.That(query.ToString(), Is.EqualTo("#goose,#chicken"));
 }
Beispiel #8
0
 public void When_New_With_Id()
 {
     DomQuery domQuery = new DomQueryBuilder("goose");
     Assert.That(domQuery.Id, Is.EqualTo("goose"));
 }
Beispiel #9
0
 public void Then_Returns_Tag_ClassName()
 {
     DomQuery query = new DomQueryBuilder().Tag(HtmlTextWriterTag.P).Descendant.Class("goose");
     Assert.That(query.ToString(), Is.EqualTo("p .goose"));
 }
Beispiel #10
0
 public void Then_Returns_Tag_Period_ClassName()
 {
     DomQuery query = new DomQueryBuilder().Tag(HtmlTextWriterTag.P).Class("chicken");
     Assert.That(query.ToString(), Is.EqualTo("p.chicken"));
 }
Beispiel #11
0
 public void Then_Returns_Tag()
 {
     DomQuery query = new DomQueryBuilder().Tag(HtmlTextWriterTag.P);
     Assert.That(query.ToString(), Is.EqualTo("p"));
 }
Beispiel #12
0
 public void Then_Returns_A_String()
 {
     string query = new DomQueryBuilder().Id("goose").Descendant.Tag(HtmlTextWriterTag.P).Descendant.Class("chicken");
     Assert.That(query, Is.EqualTo("#goose p .chicken"));
 }