Ejemplo n.º 1
0
 public void With_A_SingleID()
 {
     var query = new DomQuery("#goose", "goose");
     Assert.That(query.HasOnlyIds, Is.True);
     Assert.That(query.IsSingle, Is.True);
     Assert.That(query.Ids.First(), Is.EqualTo("goose"));
     Assert.That(query.Ids.Count(), Is.EqualTo(1));
 }
Ejemplo n.º 2
0
 public void With_A_Bunch_Of_Ids()
 {
     var query = new DomQuery("#goose, #chicken, #duck", true, new[] { "goose", "chicken", "duck" });
     Assert.That(query.HasOnlyIds, Is.True);
     Assert.That(query.IsSimple, Is.False);
     Assert.That(query.Ids.First(), Is.EqualTo("goose"));
     Assert.That(query.Ids.Count(), Is.EqualTo(3));
 }
Ejemplo n.º 3
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()));
 }
Ejemplo n.º 4
0
 public void Implicit_Cast_To_String_Works()
 {
     var query = new DomQuery("#goose", "goose");
     string squery = query;
     Assert.That(squery,Is.EqualTo("#goose"));
 }
Ejemplo n.º 5
0
 public void With_A_Bunch_Of_Ids_Throws_When_Trying_To_Get_One_Id()
 {
     var query = new DomQuery("#goose, #chicken, #duck", true, new[] { "goose", "chicken", "duck" });
     string id = query.Id;
     Assert.Fail("Should not be able to get a single id when domquery has a bunch of ids");
 }