Example #1
0
        public void DataBindDoubleCall()
        {
            TestHtmlSelect s = new TestHtmlSelect();

            s.DataSource = new string [] { "A", "B", "C" };
            s.DataBind();
            s.DataBind();
            string exp = @"<select name>
	<option value=""A"">A</option>
	<option value=""B"">B</option>
	<option value=""C"">C</option>
</select>";

            HtmlDiff.AssertAreEqual(exp, s.Render(), "DataBindDoubleCall");
        }
Example #2
0
        public void HtmlEncodeValues()
        {
            TestHtmlSelect s = new TestHtmlSelect();

            s.DataSource = new string [] { "&", "<" };
            s.DataBind();
            string exp = @"<select name>
	<option value=""&amp;"">&amp;</option>
	<option value=""&lt;"">&lt;</option>
</select>";

            HtmlDiff.AssertAreEqual(exp, s.Render(), "HtmlEncodeValues");
        }
Example #3
0
        public void DataBind1()
        {
            TestHtmlSelect s = new TestHtmlSelect();

            s.DataSource    = GetExampleData();
            s.DataTextField = "Symbol";
            s.DataBind();
            string exp = @"<select name>
	<option value=""NOVL"">NOVL</option>
	<option value=""MSFT"">MSFT</option>
	<option value=""GOOG"">GOOG</option>
</select>";

            HtmlDiff.AssertAreEqual(exp, s.Render(), "DataBind1");
        }
Example #4
0
        public void DataBind2()
        {
            TestHtmlSelect s = new TestHtmlSelect();

            s.DataSource     = GetExampleDataWithEmpty();
            s.DataTextField  = "Company";
            s.DataValueField = "Symbol";
            s.DataBind();
            string exp = @"<select name>
	<option value=""NOVL"">Novell Inc.</option>
	<option value=""MSFT""></option>
	<option value=""GOOG"">Google</option>
</select>";

            HtmlDiff.AssertAreEqual(exp, s.Render(), "DataBind2");
        }
Example #5
0
		public void HtmlEncodeValues ()
		{
			TestHtmlSelect s = new TestHtmlSelect ();
			s.DataSource = new string [] { "&", "<" };
			s.DataBind ();
			string exp = @"<select name>
	<option value=""&amp;"">&amp;</option>
	<option value=""&lt;"">&lt;</option>
</select>";
			HtmlDiff.AssertAreEqual (exp, s.Render (), "HtmlEncodeValues");
		}
Example #6
0
		public void DataBindDoubleCall ()
		{
			TestHtmlSelect s = new TestHtmlSelect ();
			s.DataSource = new string [] { "A", "B", "C" };
			s.DataBind ();
			s.DataBind ();
			string exp = @"<select name>
	<option value=""A"">A</option>
	<option value=""B"">B</option>
	<option value=""C"">C</option>
</select>";
			HtmlDiff.AssertAreEqual (exp, s.Render (), "DataBindDoubleCall");
		}
Example #7
0
		public void DataBind2 ()
		{
			TestHtmlSelect s = new TestHtmlSelect ();
			s.DataSource = GetExampleDataWithEmpty ();
			s.DataTextField = "Company";
			s.DataValueField = "Symbol";
			s.DataBind ();
			string exp = @"<select name>
	<option value=""NOVL"">Novell Inc.</option>
	<option value=""MSFT""></option>
	<option value=""GOOG"">Google</option>
</select>";
			HtmlDiff.AssertAreEqual (exp, s.Render (), "DataBind2");
		}
Example #8
0
		public void DataBind1 ()
		{
			TestHtmlSelect s = new TestHtmlSelect ();
			s.DataSource = GetExampleData ();
			s.DataTextField = "Symbol";
			s.DataBind ();
			string exp = @"<select name>
	<option value=""NOVL"">NOVL</option>
	<option value=""MSFT"">MSFT</option>
	<option value=""GOOG"">GOOG</option>
</select>";
			HtmlDiff.AssertAreEqual (exp, s.Render (), "DataBind1");
		}