public void Render_Begin_SetsDivWithAttributes() { actual = string.Empty; string expected = "<input id=\"spinner\" data-control-type=\"spinner\" name=\"spinner\" />"; SpinnerBuilder target = new SpinnerBuilder("spinner"); actual = Utility.ControlHtmlBuilder <Spinner, SpinnerBuilder>(target); Assert.AreEqual(expected, actual); }
public void Constructor_SetsControls() { actual = string.Empty; returnHtml = string.Empty; SpinnerBuilder target = new SpinnerBuilder("spinner"); returnHtml = Utility.ControlHtmlBuilder <Spinner, SpinnerBuilder>(target); actual = Utility.GetAttribute(returnHtml, "data-control-bind-source", _startTag); Assert.AreEqual(string.Empty, actual); }
public void Constructor_SetsTagName() { actual = string.Empty; returnHtml = string.Empty; SpinnerBuilder target = new SpinnerBuilder("spinner"); returnHtml = Utility.ControlHtmlBuilder <Spinner, SpinnerBuilder>(target); actual = Utility.GetTagName(returnHtml); Assert.AreEqual(_startTag, actual); }
public void Constructor_SetsId() { actual = string.Empty; returnHtml = string.Empty; SpinnerBuilder target = new SpinnerBuilder("spinner"); returnHtml = Utility.ControlHtmlBuilder <Spinner, SpinnerBuilder>(target); actual = Utility.GetAttribute(returnHtml, "id", _startTag); Assert.AreEqual("spinner", actual); }
public void Render_Begin_SetsOptions() { actual = string.Empty; string expected = "<input id=\"spinner\" data-control-type=\"spinner\" name=\"spinner\" data-control-options=\"{"disabled":true}\" />"; SpinnerBuilder target = new SpinnerBuilder("spinner"); target.Options(option => option.Disabled = true); actual = Utility.ControlHtmlBuilder <Spinner, SpinnerBuilder>(target); Assert.AreEqual(expected, actual); }
public void Render_Begin_SetsBind() { actual = string.Empty; string expected = "<input id=\"progressbar\" data-control-type=\"spinner\" name=\"progressbar\" value=\"50\" />"; SpinnerBuilder target = new SpinnerBuilder("progressbar"); //binds the value to the spinner target.DataMap(item => { item.Value = 50; }); actual = Utility.ControlHtmlBuilder <Spinner, SpinnerBuilder>(target); Assert.AreEqual(expected, actual); }