merge -r 60439:60440
[mono.git] / mcs / class / System.Web / Test / mainsoft / MainsoftWebApp / System_Web_UI_WebControls / WebControl / WebControl_Font.aspx.cs
1 //
2 // Authors:
3 //   Rafael Mizrahi   <rafim@mainsoft.com>
4 //   Erez Lotan       <erezl@mainsoft.com>
5 //   Vladimir Krasnov <vladimirk@mainsoft.com>
6 //
7 //
8 // Copyright (c) 2002-2005 Mainsoft Corporation.
9 //
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:
17 //
18 // The above copyright notice and this permission notice shall be
19 // included in all copies or substantial portions of the Software.
20 //
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.
28 //
29
30 using System;
31 using System.Web;
32 using System.Web.UI;
33 using System.Web.UI.WebControls;
34 using System.Web.UI.HtmlControls;
35
36 namespace GHTTests.System_Web_dll.System_Web_UI_WebControls
37 {
38     public class WebControl_Font
39         : GHTWebControlBase
40         {
41                 #region Web Form Designer generated code
42                 override protected void OnInit(EventArgs e) {
43                         //
44                         // CODEGEN: This call is required by the ASP.NET Web Form Designer.
45                         //
46                         InitializeComponent();
47                         base.OnInit(e);
48                 }
49                 
50                 /// <summary>
51                 /// Required method for Designer support - do not modify
52                 /// the contents of this method with the code editor.
53                 /// </summary>
54                 private void InitializeComponent() {    
55                         this.Load += new System.EventHandler(this.Page_Load);
56                 }
57                 #endregion
58
59         private void Page_Load(object sender, System.EventArgs e) {
60             HtmlForm frm  = (HtmlForm)FindControl("Form1");
61             GHTTestBegin(frm);
62                         foreach (Type currentType in TypesToTest)
63                         {
64                                 GHTHeader(currentType.ToString());
65                                 Test(currentType);
66                         }
67                         GHTTestEnd();
68         }
69
70                 private void Test(Type ctrlType)
71                 {
72                         try
73                         {
74                                 this.GHTSubTestBegin(ctrlType, "Bold");
75                                 this.TestedControl.Font.Bold = true;
76                                 this.GHTSubTestAddResult(this.TestedControl.Font.ToString());
77                         }
78                         catch (Exception exception9)
79                         {
80                                 // ProjectData.SetProjectError(exception9);
81                                 Exception exception1 = exception9;
82                                 this.GHTSubTestUnexpectedExceptionCaught(exception1);
83                                 // ProjectData.ClearProjectError();
84                         }
85                         this.GHTSubTestEnd();
86                         try
87                         {
88                                 this.GHTSubTestBegin(ctrlType, "Italic");
89                                 this.TestedControl.Font.Italic = true;
90                                 this.GHTSubTestAddResult(this.TestedControl.Font.ToString());
91                         }
92                         catch (Exception exception10)
93                         {
94                                 // ProjectData.SetProjectError(exception10);
95                                 Exception exception2 = exception10;
96                                 this.GHTSubTestUnexpectedExceptionCaught(exception2);
97                                 // ProjectData.ClearProjectError();
98                         }
99                         this.GHTSubTestEnd();
100                         try
101                         {
102                                 this.GHTSubTestBegin(ctrlType, "Name ");
103                                 this.TestedControl.Font.Name = "Lucida Console";
104                         }
105                         catch (Exception exception11)
106                         {
107                                 // ProjectData.SetProjectError(exception11);
108                                 Exception exception3 = exception11;
109                                 this.GHTSubTestUnexpectedExceptionCaught(exception3);
110                                 // ProjectData.ClearProjectError();
111                         }
112                         this.GHTSubTestEnd();
113                         try
114                         {
115                                 this.GHTSubTestBegin(ctrlType, "Names");
116                                 string[] textArray1 = new string[] { "verdana", "Lucida Console", "Courier" } ;
117                                 this.TestedControl.Font.Names = textArray1;
118                         }
119                         catch (Exception exception12)
120                         {
121                                 // ProjectData.SetProjectError(exception12);
122                                 Exception exception4 = exception12;
123                                 this.GHTSubTestUnexpectedExceptionCaught(exception4);
124                                 // ProjectData.ClearProjectError();
125                         }
126                         this.GHTSubTestEnd();
127                         try
128                         {
129                                 this.GHTSubTestBegin(ctrlType, "Overline");
130                                 this.TestedControl.Font.Overline = true;
131                                 this.GHTSubTestAddResult(this.TestedControl.Font.ToString());
132                         }
133                         catch (Exception exception13)
134                         {
135                                 // ProjectData.SetProjectError(exception13);
136                                 Exception exception5 = exception13;
137                                 this.GHTSubTestUnexpectedExceptionCaught(exception5);
138                                 // ProjectData.ClearProjectError();
139                         }
140                         this.GHTSubTestEnd();
141                         try
142                         {
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());
147                         }
148                         catch (Exception exception14)
149                         {
150                                 // ProjectData.SetProjectError(exception14);
151                                 Exception exception6 = exception14;
152                                 this.GHTSubTestUnexpectedExceptionCaught(exception6);
153                                 // ProjectData.ClearProjectError();
154                         }
155                         this.GHTSubTestEnd();
156                         try
157                         {
158                                 this.GHTSubTestBegin(ctrlType, "Strikeout");
159                                 this.TestedControl.Font.Strikeout = true;
160                                 this.GHTSubTestAddResult(this.TestedControl.Font.ToString());
161                         }
162                         catch (Exception exception15)
163                         {
164                                 // ProjectData.SetProjectError(exception15);
165                                 Exception exception7 = exception15;
166                                 this.GHTSubTestUnexpectedExceptionCaught(exception7);
167                                 // ProjectData.ClearProjectError();
168                         }
169                         this.GHTSubTestEnd();
170                         try
171                         {
172                                 this.GHTSubTestBegin(ctrlType, "Underline");
173                                 this.TestedControl.Font.Underline = true;
174                                 this.GHTSubTestAddResult(this.TestedControl.Font.ToString());
175                         }
176                         catch (Exception exception16)
177                         {
178                                 // ProjectData.SetProjectError(exception16);
179                                 Exception exception8 = exception16;
180                                 this.GHTSubTestUnexpectedExceptionCaught(exception8);
181                                 // ProjectData.ClearProjectError();
182                         }
183                         this.GHTSubTestEnd();
184                 }
185  
186         }
187 }