public void WidgetsTest() { BaseMultiWidget target = CreateBaseMultiWidget(); Assert.IsInstanceOfType(target.Widgets[0], typeof(TextInput)); Assert.IsInstanceOfType(target.Widgets[1], typeof(CheckBoxInput)); }
public void RenderTest() { BaseMultiWidget target = CreateBaseMultiWidget(); Assert.AreEqual("<input type=\"text\" name=\"Test10\" value=\"1\" />\n<input type=\"checkbox\" name=\"Test11\" checked=\"checked\" value=\"True\" />", target.Render("Test1", null)); Assert.AreEqual("<input id=\"Test1_0\" type=\"text\" name=\"Test10\" value=\"1\" />\n<input id=\"Test1_1\" type=\"checkbox\" name=\"Test11\" checked=\"checked\" value=\"True\" />", target.Render("Test1", null, new ElementAttributesDictionary { { "id", "Test1" } })); }
public void GetValueFromDataCollectionTest() { BaseMultiWidget target = CreateBaseMultiWidget(); // TODO: Initialize to an appropriate value var data = new NameValueCollection { { "Test10", "Test1" }, { "Test11", bool.TrueString }, }; AssertExtras.AreEqual(new object[] { "Test1", bool.TrueString }, target.GetValueFromDataCollection(data, null, "Test1") as IEnumerable); }
public void IdForLabelTest() { BaseMultiWidget target = CreateBaseMultiWidget(); Assert.AreEqual("Test1_0", target.IdForLabel("Test1")); }