public void When_Creating_element_With_Dictionary_Sticks() { var hash = new Hash {{"Key1", "Val1"}, {"Key2", "Val2"}, {"Key3", "Val3"}}; var element = new TextArea(hash); Assert.That(element.Tag, Is.EqualTo("textarea")); Assert.That(element.Attributes.Count == 3); Assert.That(element["Key1"] == "Val1"); }
public void Tag_Is_Correct() { var element = new TextArea(); Assert.That(element.Tag, Is.EqualTo("textarea")); }
public void Int_Properties_Work_Right() { var element = new TextArea(); Assert.That(element.Rows == 0); Assert.That(element.Cols == 0); Assert.That(element["rows"] == null); Assert.That(element["cols"] == null); element["rows"] = "A bad value"; Assert.That(element.Rows == 0); element["cols"] = "A bad value"; Assert.That(element.Cols == 0); element.Cols = 10; element.Rows = 10; Assert.That(element.Cols == 10); Assert.That(element.Rows == 10); Assert.That(element["rows"] == "10"); Assert.That(element["cols"] == "10"); element.Rows = -1; element.Cols = 0; Assert.That(element.Cols == 0); Assert.That(element.Rows == 0); Assert.That(element["rows"] == null); Assert.That(element["cols"] == null); }
public void Properties_Stick_When_Set() { var element = new TextArea {Value = "Value&Sticks"}; Assert.That(element.Value.ToString() == "Value&Sticks"); Assert.That(element.InnerText == "Value&Sticks"); Assert.That(element.ToString(), Is.EqualTo("<textarea >Value&Sticks</textarea>")); element.Value = null; Assert.That(element.Value.ToString() == ""); Assert.That(element.InnerText == ""); element.Name = "Name Sticks"; Assert.That(element.Name == "Name Sticks"); element.OnBlur = "OnBlur Sticks"; Assert.That(element.OnBlur == "OnBlur Sticks"); element.OnFocus = "OnFocus Sticks"; Assert.That(element.OnFocus == "OnFocus Sticks"); element.OnSelect = "OnSelect Sticks"; Assert.That(element.OnSelect == "OnSelect Sticks"); element.OnChange = "OnChange Sticks"; Assert.That(element.OnChange == "OnChange Sticks"); }
public void Bool_Properties_Work_Right() { var element = new TextArea(); Assert.That(element.Disabled == false); Assert.That(element.ReadOnly == false); Assert.That(element["disabled"] == null); Assert.That(element["readonly"] == null); element.Disabled = true; element.ReadOnly = true; Assert.That(element.Disabled); Assert.That(element.ReadOnly); Assert.That(element["disabled"] == "disabled"); Assert.That(element["readonly"] == "readonly"); element["disabled"] = "manual edit bad"; element["readonly"] = "manual edit bad"; Assert.That(element.Disabled == false); Assert.That(element.ReadOnly == false); element.Disabled = false; element.ReadOnly = false; Assert.That(element.Disabled == false); Assert.That(element.ReadOnly == false); Assert.That(element["disabled"] == null); Assert.That(element["readonly"] == null); }