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;
36 namespace GHTTests.System_Web_dll.System_Web_UI_WebControls
38 public class WebControl_Font
41 #region Web Form Designer generated code
42 override protected void OnInit(EventArgs e) {
44 // CODEGEN: This call is required by the ASP.NET Web Form Designer.
46 InitializeComponent();
51 /// Required method for Designer support - do not modify
52 /// the contents of this method with the code editor.
54 private void InitializeComponent() {
55 this.Load += new System.EventHandler(this.Page_Load);
59 private void Page_Load(object sender, System.EventArgs e) {
60 HtmlForm frm = (HtmlForm)FindControl("Form1");
62 foreach (Type currentType in TypesToTest)
64 GHTHeader(currentType.ToString());
70 private void Test(Type ctrlType)
74 this.GHTSubTestBegin(ctrlType, "Bold");
75 this.TestedControl.Font.Bold = true;
76 this.GHTSubTestAddResult(this.TestedControl.Font.ToString());
78 catch (Exception exception9)
80 // ProjectData.SetProjectError(exception9);
81 Exception exception1 = exception9;
82 this.GHTSubTestUnexpectedExceptionCaught(exception1);
83 // ProjectData.ClearProjectError();
88 this.GHTSubTestBegin(ctrlType, "Italic");
89 this.TestedControl.Font.Italic = true;
90 this.GHTSubTestAddResult(this.TestedControl.Font.ToString());
92 catch (Exception exception10)
94 // ProjectData.SetProjectError(exception10);
95 Exception exception2 = exception10;
96 this.GHTSubTestUnexpectedExceptionCaught(exception2);
97 // ProjectData.ClearProjectError();
102 this.GHTSubTestBegin(ctrlType, "Name ");
103 this.TestedControl.Font.Name = "Lucida Console";
105 catch (Exception exception11)
107 // ProjectData.SetProjectError(exception11);
108 Exception exception3 = exception11;
109 this.GHTSubTestUnexpectedExceptionCaught(exception3);
110 // ProjectData.ClearProjectError();
112 this.GHTSubTestEnd();
115 this.GHTSubTestBegin(ctrlType, "Names");
116 string[] textArray1 = new string[] { "verdana", "Lucida Console", "Courier" } ;
117 this.TestedControl.Font.Names = textArray1;
119 catch (Exception exception12)
121 // ProjectData.SetProjectError(exception12);
122 Exception exception4 = exception12;
123 this.GHTSubTestUnexpectedExceptionCaught(exception4);
124 // ProjectData.ClearProjectError();
126 this.GHTSubTestEnd();
129 this.GHTSubTestBegin(ctrlType, "Overline");
130 this.TestedControl.Font.Overline = true;
131 this.GHTSubTestAddResult(this.TestedControl.Font.ToString());
133 catch (Exception exception13)
135 // ProjectData.SetProjectError(exception13);
136 Exception exception5 = exception13;
137 this.GHTSubTestUnexpectedExceptionCaught(exception5);
138 // ProjectData.ClearProjectError();
140 this.GHTSubTestEnd();
143 this.GHTSubTestBegin(ctrlType, "FontSize");
144 FontUnit unit1 = new FontUnit(FontSize.XXLarge);
145 this.TestedControl.Font.Size = unit1;
146 this.GHTSubTestAddResult(this.TestedControl.Font.ToString());
148 catch (Exception exception14)
150 // ProjectData.SetProjectError(exception14);
151 Exception exception6 = exception14;
152 this.GHTSubTestUnexpectedExceptionCaught(exception6);
153 // ProjectData.ClearProjectError();
155 this.GHTSubTestEnd();
158 this.GHTSubTestBegin(ctrlType, "Strikeout");
159 this.TestedControl.Font.Strikeout = true;
160 this.GHTSubTestAddResult(this.TestedControl.Font.ToString());
162 catch (Exception exception15)
164 // ProjectData.SetProjectError(exception15);
165 Exception exception7 = exception15;
166 this.GHTSubTestUnexpectedExceptionCaught(exception7);
167 // ProjectData.ClearProjectError();
169 this.GHTSubTestEnd();
172 this.GHTSubTestBegin(ctrlType, "Underline");
173 this.TestedControl.Font.Underline = true;
174 this.GHTSubTestAddResult(this.TestedControl.Font.ToString());
176 catch (Exception exception16)
178 // ProjectData.SetProjectError(exception16);
179 Exception exception8 = exception16;
180 this.GHTSubTestUnexpectedExceptionCaught(exception8);
181 // ProjectData.ClearProjectError();
183 this.GHTSubTestEnd();