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);
 }
Exemple #2
0
 public bool HasProperty(CssProperty property)
 {
     return Properties.FirstOrDefault(p => p.Key == property.Key && p.Value == property.Value) != null;
 }
Exemple #3
0
 public CssElement AddProperty(CssProperty property)
 {
     if(!HasProperty(property))
         Properties.Add(property);
     return this;
 }
 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);
 }