예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }
예제 #5
0
        public void Render_Begin_SetsOptions()
        {
            actual = string.Empty;
            string         expected = "<input id=\"spinner\" data-control-type=\"spinner\" name=\"spinner\" data-control-options=\"{&quot;disabled&quot;:true}\" />";
            SpinnerBuilder target   = new SpinnerBuilder("spinner");

            target.Options(option => option.Disabled = true);
            actual = Utility.ControlHtmlBuilder <Spinner, SpinnerBuilder>(target);
            Assert.AreEqual(expected, actual);
        }
예제 #6
0
        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);
        }