Exemplo n.º 1
0
 public void Cannot_AddProperties_Twice_Get_And_Set_Values()
 {
     var element = new CssElement("a > a:Hover");
     var property = new CssProperty("background", "red");
     element.AddProperty(property);
     element.AddProperty(property);
     Assert.AreEqual(1, element.Properties.Count);
 }
Exemplo n.º 2
0
 public bool HasProperty(CssProperty property)
 {
     return Properties.FirstOrDefault(p => p.Key == property.Key && p.Value == property.Value) != null;
 }
Exemplo n.º 3
0
 public CssElement AddProperty(CssProperty property)
 {
     if(!HasProperty(property))
         Properties.Add(property);
     return this;
 }
Exemplo n.º 4
0
 public void Can_Get_And_Set_Property_Values()
 {
     var property = new CssProperty("background", "solid 1px blue");
     Assert.AreEqual("background", property.Key);
     Assert.AreEqual("solid 1px blue", property.Value);
 }