Пример #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);
        }