3 // Rafael Mizrahi <rafim@mainsoft.com>
4 // Erez Lotan <erezl@mainsoft.com>
5 // Vladimir Krasnov <vladimirk@mainsoft.com>
8 // Copyright (c) 2002-2005 Mainsoft Corporation.
10 // Permission is hereby granted, free of charge, to any person obtaining
11 // a copy of this software and associated documentation files (the
12 // "Software"), to deal in the Software without restriction, including
13 // without limitation the rights to use, copy, modify, merge, publish,
14 // distribute, sublicense, and/or sell copies of the Software, and to
15 // permit persons to whom the Software is furnished to do so, subject to
16 // the following conditions:
18 // The above copyright notice and this permission notice shall be
19 // included in all copies or substantial portions of the Software.
21 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
25 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33 using System.Web.UI.WebControls;
34 using System.Web.UI.HtmlControls;
35 using System.Collections;
37 namespace GHTTests.System_Web_dll.System_Web_UI_WebControls
39 public class WebControl_TableStyle_BackImageUrl
42 #region Web Form Designer generated code
43 override protected void OnInit(EventArgs e) {
45 // CODEGEN: This call is required by the ASP.NET Web Form Designer.
47 InitializeComponent();
52 /// Required method for Designer support - do not modify
53 /// the contents of this method with the code editor.
55 private void InitializeComponent() {
56 this.Load += new System.EventHandler(this.Page_Load);
60 //Overrides GHTWebControlBase.InitTypes
61 //This method initializes the types that will be contained in the TypesToTest array.
62 //This only controls that TableStyle is relevant for, will be tested.
63 protected override void InitTypes()
65 base.m_derivedTypes = new ArrayList();
66 base.m_derivedTypes.Add(typeof(RadioButtonList));
67 base.m_derivedTypes.Add(typeof(CheckBoxList));
68 base.m_derivedTypes.Add(typeof(DataGrid));
69 base.m_derivedTypes.Add(typeof(DataList));
70 base.m_derivedTypes.Add(typeof(Table));
75 private void Page_Load(object sender, System.EventArgs e)
77 HtmlForm frm = (HtmlForm)FindControl("Form1");
79 foreach (Type currentType in TypesToTest)
81 GHTHeader(currentType.ToString());
87 private void Test(Type ctrlType)
91 this.GHTSubTestBegin(ctrlType, "Relative path");
92 TableStyle style1 = (TableStyle) this.TestedControl.ControlStyle;
93 style1.BackImageUrl = "cat.jpg";
95 catch (Exception exception8)
97 // ProjectData.SetProjectError(exception8);
98 Exception exception1 = exception8;
99 this.GHTSubTestUnexpectedExceptionCaught(exception1);
100 // ProjectData.ClearProjectError();
102 this.GHTSubTestEnd();
105 this.GHTSubTestBegin(ctrlType, "absolute path");
106 TableStyle style2 = (TableStyle) this.TestedControl.ControlStyle;
107 style2.BackImageUrl = "http://localhost:/System_Web_dll/System_Web_UI_WebControls/WebControl/cat.jpg";
109 catch (Exception exception9)
111 // ProjectData.SetProjectError(exception9);
112 Exception exception2 = exception9;
113 this.GHTSubTestUnexpectedExceptionCaught(exception2);
114 // ProjectData.ClearProjectError();
116 this.GHTSubTestEnd();
119 this.GHTSubTestBegin(ctrlType, "Defied only in CssClass");
120 TableStyle style3 = (TableStyle) this.TestedControl.ControlStyle;
121 style3.CssClass = "CssClass1";
123 catch (Exception exception10)
125 // ProjectData.SetProjectError(exception10);
126 Exception exception3 = exception10;
127 this.GHTSubTestUnexpectedExceptionCaught(exception3);
128 // ProjectData.ClearProjectError();
130 this.GHTSubTestEnd();
133 this.GHTSubTestBegin(ctrlType, "Defied only in CssClass");
134 TableStyle style4 = (TableStyle) this.TestedControl.ControlStyle;
135 style4.CssClass = "CssClass1";
136 style4.BackImageUrl = "http://localhost:/System_Web_dll/System_Web_UI_WebControls/WebControl/dog.jpg";
138 catch (Exception exception11)
140 // ProjectData.SetProjectError(exception11);
141 Exception exception4 = exception11;
142 this.GHTSubTestUnexpectedExceptionCaught(exception4);
143 // ProjectData.ClearProjectError();
145 this.GHTSubTestEnd();
148 this.GHTSubTestBegin(ctrlType, "Default value");
149 TableStyle style5 = (TableStyle) this.TestedControl.ControlStyle;
150 this.GHTSubTestAddResult(style5.BackImageUrl);
152 catch (Exception exception12)
154 // ProjectData.SetProjectError(exception12);
155 Exception exception5 = exception12;
156 this.GHTSubTestUnexpectedExceptionCaught(exception5);
157 // ProjectData.ClearProjectError();
159 this.GHTSubTestEnd();
162 this.GHTSubTestBegin(ctrlType, "Throws exception on null value");
163 TableStyle style6 = (TableStyle) this.TestedControl.ControlStyle;
164 style6.BackImageUrl = null;
165 this.GHTSubTestExpectedExceptionNotCaught("ArgumentNullException");
167 catch (ArgumentNullException exception13)
169 // ProjectData.SetProjectError(exception13);
170 ArgumentNullException exception6 = exception13;
171 this.GHTSubTestExpectedExceptionCaught(exception6);
172 // ProjectData.ClearProjectError();
174 catch (Exception exception14)
176 // ProjectData.SetProjectError(exception14);
177 Exception exception7 = exception14;
178 this.GHTSubTestUnexpectedExceptionCaught(exception7);
179 // ProjectData.ClearProjectError();
181 this.GHTSubTestEnd();