public void FormatCheckboxNull() { CheckboxControl control = new CheckboxControl { Value = "checked" }; ApplicationValueFormatter formatter = new ApplicationValueFormatter(); string formattedValue = formatter.FormatApplicationValue(null, control); Assert.AreEqual(string.Empty, formattedValue); }
public void TestControlTypes() { TextControl textControl = new TextControl(); Assert.AreEqual(ControlType.Text, textControl.Type); ComboControl comboControl = new ComboControl(); Assert.AreEqual(ControlType.Combo, comboControl.Type); RadioControl radioControl = new RadioControl(); Assert.AreEqual(ControlType.Radio, radioControl.Type); CheckboxControl checkboxControl = new CheckboxControl(); Assert.AreEqual(ControlType.Checkbox, checkboxControl.Type); CheckboxGroupControl checkboxGroupControl = new CheckboxGroupControl(); Assert.AreEqual(ControlType.CheckboxGroup, checkboxGroupControl.Type); DateControl dateControl = new DateControl(); Assert.AreEqual(ControlType.Date, dateControl.Type); TimeControl timeControl = new TimeControl(); Assert.AreEqual(ControlType.Time, timeControl.Type); FileBrowserControl fileBrowserControl = new FileBrowserControl(); Assert.AreEqual(ControlType.FileBrowser, fileBrowserControl.Type); HiddenControl hiddenControl = new HiddenControl(); Assert.AreEqual(ControlType.Hidden, hiddenControl.Type); LabelControl labelControl = new LabelControl(); Assert.AreEqual(ControlType.Label, labelControl.Type); HtmlControl htmlControl = new HtmlControl(); Assert.AreEqual(ControlType.Html, htmlControl.Type); GroupControl groupControl = new GroupControl(); Assert.AreEqual(ControlType.Group, groupControl.Type); RepeaterControl repeaterControl = new RepeaterControl(); Assert.AreEqual(ControlType.Repeater, repeaterControl.Type); CalculationControl calculationControl = new CalculationControl(); Assert.AreEqual(ControlType.Calculation, calculationControl.Type); SignaturePadControl signaturePadControl = new SignaturePadControl(); Assert.AreEqual(ControlType.SignaturePad, signaturePadControl.Type); GeolocationControl geolocationControl = new GeolocationControl(); Assert.AreEqual(ControlType.Geolocation, geolocationControl.Type); HeadingControl headingControl = new HeadingControl(); Assert.AreEqual(ControlType.Heading, headingControl.Type); }
public void FormatCheckboxTrue() { CheckboxControl control = new CheckboxControl { Value = "checked" }; ApplicationValueFormatter formatter = new ApplicationValueFormatter(); string formattedValue = formatter.FormatApplicationValue("checked", control); Assert.AreEqual("True", formattedValue); }