New test.
[mono.git] / mcs / class / System.Web / Test / System.Web.UI.WebControls / CreateUserWizardTest.cs
1 //
2 // WizardTest.cs - Unit tests for System.Web.UI.WebControls.Wizard
3 //
4 // Author:
5 //      Vladimir Krasnov  <vladimirk@mainsoft.com>
6 //
7 // (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
8 //
9 // Permission is hereby granted, free of charge, to any person obtaining
10 // a copy of this software and associated documentation files (the
11 // "Software"), to deal in the Software without restriction, including
12 // without limitation the rights to use, copy, modify, merge, publish,
13 // distribute, sublicense, and/or sell copies of the Software, and to
14 // permit persons to whom the Software is furnished to do so, subject to
15 // the following conditions:
16 // 
17 // The above copyright notice and this permission notice shall be
18 // included in all copies or substantial portions of the Software.
19 // 
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 //
28
29 #if NET_2_0
30
31 using System;
32 using System.Drawing;
33 using System.Threading;
34 using System.Collections;
35 using System.IO;
36 using System.Web;
37 using System.Web.UI;
38 using System.Web.UI.WebControls;
39 using System.Web.Security;
40 using System.Text.RegularExpressions;
41 using MonoTests.SystemWeb.Framework;
42 using MonoTests.stand_alone.WebHarness;
43
44 using NUnit.Framework;
45
46 namespace MonoTests.System.Web.UI.WebControls
47 {
48
49         public class TestCreateUserWizard : CreateUserWizard
50         {
51
52                 public string Tag
53                 {
54                         get { return base.TagName; }
55                 }
56
57                 public StateBag StateBag
58                 {
59                         get { return base.ViewState; }
60                 }
61
62                 public string Render ()
63                 {
64                         StringWriter sw = new StringWriter ();
65                         sw.NewLine = "\n";
66                         HtmlTextWriter writer = new HtmlTextWriter (sw);
67                         base.Render (writer);
68                         return writer.InnerWriter.ToString ();
69                 }
70
71                 public Style GetStyle ()
72                 {
73                         return base.CreateControlStyle ();
74                 }
75
76                 public void TrackState ()
77                 {
78                         TrackViewState ();
79                 }
80
81                 public void LoadState (object state)
82                 {
83                         LoadViewState (state);
84                 }
85
86                 public object SaveState ()
87                 {
88                         return SaveViewState ();
89                 }
90
91                 public void SetDesignMode (IDictionary dic)
92                 {
93                         base.SetDesignModeState (dic);
94                 }
95
96                 private bool onBubble;
97
98                 public bool OnBubbleEventCalled
99                 {
100                         get { return onBubble; }
101                         set { onBubble = value; }
102                 }
103
104                 protected override bool OnBubbleEvent (object source, EventArgs e)
105                 {
106                         onBubble = true;
107                         return base.OnBubbleEvent (source, e);
108                 }
109
110                 public bool DoBubbleEvent (object source, EventArgs e)
111                 {
112                         return base.OnBubbleEvent (source, e);
113                 }
114
115                 public void DoEnsureChildControls ()
116                 {
117                         base.EnsureChildControls ();
118                 }
119                 
120                 public bool DoOnBubbleEvent (EventArgs e) {
121                         return base.OnBubbleEvent (this, e);
122                 }
123         }
124
125         [Serializable]
126         [TestFixture]
127         public class CreateUserWizardTest
128         {
129                 [SetUp]
130                 public void TestSetup ()
131                 {
132                         Thread.Sleep (150);
133                 }
134
135                 [Test]
136                 public void DefaultProperties ()
137                 {
138                         TestCreateUserWizard w = new TestCreateUserWizard ();
139                         Assert.AreEqual (0, w.Attributes.Count, "Attributes.Count");
140                         Assert.AreEqual (0, w.StateBag.Count, "ViewState.Count");
141
142                         Assert.AreEqual ("Security Answer:", w.AnswerLabelText, "AnswerLabelText");
143                         Assert.AreEqual ("Security answer is required.", w.AnswerRequiredErrorMessage, "AnswerRequiredErrorMessage");
144                         Assert.IsFalse (w.AutoGeneratePassword, "AutoGeneratePassword");
145                         Assert.AreEqual ("Your account has been successfully created.", w.CompleteSuccessText, "CompleteSuccessText");
146                         Assert.AreEqual ("The Password and Confirmation Password must match.", w.ConfirmPasswordCompareErrorMessage, "ConfirmPasswordCompareErrorMessage");
147                         Assert.AreEqual ("Confirm Password:", w.ConfirmPasswordLabelText, "ConfirmPasswordLabelText");
148                         Assert.AreEqual ("Confirm Password is required.", w.ConfirmPasswordRequiredErrorMessage, "ConfirmPasswordRequiredErrorMessage");
149                         Assert.AreEqual (string.Empty, w.ContinueButtonImageUrl, "ContinueButtonImageUrl");
150                         Assert.AreEqual ("Continue", w.ContinueButtonText, "ContinueButtonText");
151                         Assert.AreEqual (ButtonType.Button, w.ContinueButtonType, "ContinueButtonType");
152                         Assert.AreEqual (string.Empty, w.ContinueDestinationPageUrl, "ContinueDestinationPageUrl");
153                         Assert.AreEqual (string.Empty, w.CreateUserButtonImageUrl, "CreateUserButtonImageUrl");
154                         Assert.AreEqual ("Create User", w.CreateUserButtonText, "CreateUserButtonText");
155                         Assert.AreEqual (ButtonType.Button, w.CreateUserButtonType, "CreateUserButtonType");
156                         Assert.IsFalse (w.DisableCreatedUser, "DisableCreatedUser");
157                         Assert.AreEqual ("The e-mail address that you entered is already in use. Please enter a different e-mail address.", w.DuplicateEmailErrorMessage, "DuplicateEmailErrorMessage");
158                         Assert.AreEqual ("Please enter a different user name.", w.DuplicateUserNameErrorMessage, "DuplicateUserNameErrorMessage");
159                         Assert.AreEqual (string.Empty, w.EditProfileIconUrl, "EditProfileIconUrl");
160                         Assert.AreEqual (string.Empty, w.EditProfileText, "EditProfileText");
161                         Assert.AreEqual (string.Empty, w.EditProfileUrl, "EditProfileUrl");
162                         Assert.AreEqual ("E-mail:", w.EmailLabelText, "EmailLabelText");
163                         Assert.AreEqual (string.Empty, w.EmailRegularExpression, "EmailRegularExpression");
164                         Assert.AreEqual ("Please enter a different e-mail.", w.EmailRegularExpressionErrorMessage, "EmailRegularExpressionErrorMessage");
165                         Assert.AreEqual ("E-mail is required.", w.EmailRequiredErrorMessage, "EmailRequiredErrorMessage");
166                         Assert.AreEqual (string.Empty, w.HelpPageIconUrl, "HelpPageIconUrl");
167                         Assert.AreEqual (string.Empty, w.HelpPageText, "HelpPageText");
168                         Assert.AreEqual (string.Empty, w.HelpPageUrl, "HelpPageUrl");
169                         Assert.AreEqual (string.Empty, w.InstructionText, "InstructionText");
170                         Assert.AreEqual ("Please enter a different security answer.", w.InvalidAnswerErrorMessage, "InvalidAnswerErrorMessage");
171                         Assert.AreEqual ("Please enter a valid e-mail address.", w.InvalidEmailErrorMessage, "InvalidEmailErrorMessage");
172                         Assert.AreEqual ("Password length minimum: {0}. Non-alphanumeric characters required: {1}.", w.InvalidPasswordErrorMessage, "InvalidPasswordErrorMessage");
173                         Assert.AreEqual ("Please enter a different security question.", w.InvalidQuestionErrorMessage, "InvalidQuestionErrorMessage");
174                         Assert.IsTrue (w.LoginCreatedUser, "LoginCreatedUser");
175                         Assert.AreEqual (string.Empty, w.MembershipProvider, "MembershipProvider");
176                         Assert.AreEqual (string.Empty, w.PasswordHintText, "PasswordHintText");
177                         Assert.AreEqual ("Password:", w.PasswordLabelText, "PasswordLabelText");
178                         Assert.AreEqual (string.Empty, w.PasswordRegularExpression, "PasswordRegularExpression");
179                         Assert.AreEqual ("Please enter a different password.", w.PasswordRegularExpressionErrorMessage, "PasswordRegularExpressionErrorMessage");
180                         Assert.AreEqual ("Password is required.", w.PasswordRequiredErrorMessage, "PasswordRequiredErrorMessage");
181                         Assert.AreEqual ("Security Question:", w.QuestionLabelText, "QuestionLabelText");
182                         Assert.AreEqual ("Security question is required.", w.QuestionRequiredErrorMessage, "QuestionRequiredErrorMessage");
183                         Assert.IsTrue (w.RequireEmail, "RequireEmail");
184                         Assert.AreEqual ("Your account was not created. Please try again.", w.UnknownErrorMessage, "UnknownErrorMessage");
185                         Assert.AreEqual ("User Name:", w.UserNameLabelText, "UserNameLabelText");
186                         Assert.AreEqual ("User Name is required.", w.UserNameRequiredErrorMessage, "UserNameRequiredErrorMessage");
187                         Assert.IsNotNull (w.WizardSteps, "WizardSteps");
188                 }
189
190                 [Test]
191                 public void AssignToDefaultProperties ()
192                 {
193                         TestCreateUserWizard w = new TestCreateUserWizard ();
194                         Assert.AreEqual (0, w.Attributes.Count, "Attributes.Count");
195                         Assert.AreEqual (0, w.StateBag.Count, "ViewState.Count");
196
197                         int count = 0;
198
199                         w.AnswerLabelText = "value";
200                         Assert.AreEqual ("value", w.AnswerLabelText, "CancelButtonImageUrl");
201                         Assert.AreEqual (++count, w.StateBag.Count, "ViewState.Count-1");
202
203                         w.AutoGeneratePassword = true;
204                         Assert.AreEqual (true, w.AutoGeneratePassword, "Assign AutoGeneratePassword");
205                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate AutoGeneratePassword");
206
207                         w.CompleteSuccessText = "text";
208                         Assert.AreEqual ("text", w.CompleteSuccessText, "Assign CompleteSuccessText");
209                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate CompleteSuccessText");
210
211                         w.ConfirmPasswordCompareErrorMessage = "text";
212                         Assert.AreEqual ("text", w.ConfirmPasswordCompareErrorMessage, "Assign ConfirmPasswordCompareErrorMessage,");
213                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate ConfirmPasswordCompareErrorMessage,");
214
215                         w.ConfirmPasswordLabelText = "text";
216                         Assert.AreEqual ("text", w.ConfirmPasswordLabelText, "Assign ConfirmPasswordLabelText");
217                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate ConfirmPasswordLabelText");
218
219                         w.ConfirmPasswordRequiredErrorMessage = "text";
220                         Assert.AreEqual ("text", w.ConfirmPasswordRequiredErrorMessage, "Assign ConfirmPasswordRequiredErrorMessage");
221                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate ConfirmPasswordRequiredErrorMessage");
222
223                         w.ContinueButtonImageUrl = "text";
224                         Assert.AreEqual ("text", w.ContinueButtonImageUrl, "Assign ContinueButtonImageUrl");
225                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate ContinueButtonImageUrl");
226
227                         w.ContinueButtonText = "text";
228                         Assert.AreEqual ("text", w.ContinueButtonText, "Assign ContinueButtonText");
229                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate ContinueButtonText");
230
231                         //w.ContinueButtonType = ButtonType.Button;
232                         //Assert.AreEqual(ButtonType.Button, w.ContinueButtonType, "Assign ContinueButtonType");
233                         //Assert.AreEqual(count, w.StateBag.Count, "Viewstate ContinueButtonType");
234
235                         w.ContinueDestinationPageUrl = "text";
236                         Assert.AreEqual ("text", w.ContinueDestinationPageUrl, "Assign ContinueDestinationPageUrl");
237                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate ContinueDestinationPageUrl");
238
239                         w.CreateUserButtonImageUrl = "text";
240                         Assert.AreEqual ("text", w.CreateUserButtonImageUrl, "Assign CreateUserButtonImageUrl");
241                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate CreateUserButtonImageUrl");
242
243                         w.CreateUserButtonText = "text";
244                         Assert.AreEqual ("text", w.CreateUserButtonText, "Assign CreateUserButtonText");
245                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate CreateUserButtonText");
246
247                         //w.CreateUserButtonType = ButtonType.Button;
248                         //Assert.AreEqual(ButtonType.Button, w.CreateUserButtonType, "Assign CreateUserButtonType");
249                         //Assert.AreEqual(count, w.StateBag.Count, "Viewstate CreateUserButtonType");
250
251                         w.DisableCreatedUser = false;
252                         Assert.AreEqual (false, w.DisableCreatedUser, "Assign DisableCreatedUser");
253                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate DisableCreatedUser");
254
255                         w.DuplicateEmailErrorMessage = "msg";
256                         Assert.AreEqual ("msg", w.DuplicateEmailErrorMessage, "Assign DuplicateEmailErrorMessage");
257                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate DuplicateEmailErrorMessage");
258
259                         w.DuplicateUserNameErrorMessage = "msg";
260                         Assert.AreEqual ("msg", w.DuplicateUserNameErrorMessage, "Assign DuplicateUserNameErrorMessage");
261                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate DuplicateUserNameErrorMessage");
262
263                         w.EditProfileIconUrl = "msg";
264                         Assert.AreEqual ("msg", w.EditProfileIconUrl, "Assign EditProfileIconUrl");
265                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate EditProfileIconUrl");
266
267                         w.EditProfileText = "msg";
268                         Assert.AreEqual ("msg", w.EditProfileText, "Assign EditProfileText");
269                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate EditProfileText");
270
271                         w.EditProfileUrl = "msg";
272                         Assert.AreEqual ("msg", w.EditProfileUrl, "Assign EditProfileUrl");
273                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate EditProfileUrl");
274
275                         w.EmailLabelText = "msg";
276                         Assert.AreEqual ("msg", w.EmailLabelText, "Assign EmailLabelText");
277                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate EmailLabelText");
278
279                         w.EmailRegularExpression = "msg";
280                         Assert.AreEqual ("msg", w.EmailRegularExpression, "Assign EmailRegularExpression");
281                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate EmailRegularExpression");
282
283                         w.EmailRegularExpressionErrorMessage = "msg";
284                         Assert.AreEqual ("msg", w.EmailRegularExpressionErrorMessage, "Assign EmailRegularExpressionErrorMessage");
285                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate EmailRegularExpressionErrorMessage");
286
287                         w.EmailRequiredErrorMessage = "msg";
288                         Assert.AreEqual ("msg", w.EmailRequiredErrorMessage, "Assign EmailRequiredErrorMessage");
289                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate EmailRequiredErrorMessage");
290
291                         w.HelpPageIconUrl = "msg";
292                         Assert.AreEqual ("msg", w.HelpPageIconUrl, "Assign HelpPageIconUrl");
293                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate HelpPageIconUrl");
294
295                         w.HelpPageText = "msg";
296                         Assert.AreEqual ("msg", w.HelpPageText, "Assign HelpPageText");
297                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate HelpPageText");
298
299                         w.HelpPageUrl = "msg";
300                         Assert.AreEqual ("msg", w.HelpPageUrl, "Assign HelpPageUrl");
301                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate HelpPageUrl");
302
303                         w.InstructionText = "msg";
304                         Assert.AreEqual ("msg", w.InstructionText, "Assign InstructionText");
305                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate InstructionText");
306
307                         w.InvalidAnswerErrorMessage = "msg";
308                         Assert.AreEqual ("msg", w.InvalidAnswerErrorMessage, "Assign InvalidAnswerErrorMessage");
309                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate InvalidAnswerErrorMessage");
310
311                         w.InvalidEmailErrorMessage = "msg";
312                         Assert.AreEqual ("msg", w.InvalidEmailErrorMessage, "Assign InvalidEmailErrorMessage");
313                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate InvalidEmailErrorMessage");
314
315                         w.InvalidPasswordErrorMessage = "msg";
316                         Assert.AreEqual ("msg", w.InvalidPasswordErrorMessage, "Assign InvalidPasswordErrorMessage");
317                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate InvalidPasswordErrorMessage");
318
319                         w.InvalidQuestionErrorMessage = "msg";
320                         Assert.AreEqual ("msg", w.InvalidQuestionErrorMessage, "Assign InvalidQuestionErrorMessage");
321                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate InvalidQuestionErrorMessage");
322
323                         w.LoginCreatedUser = false;
324                         Assert.AreEqual (false, w.LoginCreatedUser, "Assign LoginCreatedUser");
325                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate LoginCreatedUser");
326
327                         w.MembershipProvider = "msg";
328                         Assert.AreEqual ("msg", w.MembershipProvider, "Assign MembershipProvider");
329                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate MembershipProvider");
330
331                         w.PasswordHintText = "msg";
332                         Assert.AreEqual ("msg", w.PasswordHintText, "Assign PasswordHintText");
333                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate PasswordHintText");
334
335                         w.PasswordLabelText = "msg";
336                         Assert.AreEqual ("msg", w.PasswordLabelText, "Assign PasswordLabelText");
337                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate PasswordLabelText");
338
339                         w.PasswordRegularExpression = "msg";
340                         Assert.AreEqual ("msg", w.PasswordRegularExpression, "Assign PasswordRegularExpression");
341                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate PasswordRegularExpression");
342
343                         w.PasswordRegularExpressionErrorMessage = "msg";
344                         Assert.AreEqual ("msg", w.PasswordRegularExpressionErrorMessage, "Assign PasswordRegularExpressionErrorMessage");
345                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate PasswordRegularExpressionErrorMessage");
346
347                         w.PasswordRequiredErrorMessage = "msg";
348                         Assert.AreEqual ("msg", w.PasswordRequiredErrorMessage, "Assign PasswordRequiredErrorMessage");
349                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate PasswordRequiredErrorMessage");
350
351                         w.QuestionLabelText = "msg";
352                         Assert.AreEqual ("msg", w.QuestionLabelText, "Assign QuestionLabelText");
353                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate QuestionLabelText");
354
355                         w.QuestionRequiredErrorMessage = "msg";
356                         Assert.AreEqual ("msg", w.QuestionRequiredErrorMessage, "Assign QuestionRequiredErrorMessage");
357                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate QuestionRequiredErrorMessage");
358
359                         w.RequireEmail = false;
360                         Assert.AreEqual (false, w.RequireEmail, "Assign RequireEmail");
361                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate RequireEmail");
362
363                         w.UnknownErrorMessage = "msg";
364                         Assert.AreEqual ("msg", w.UnknownErrorMessage, "Assign UnknownErrorMessage");
365                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate UnknownErrorMessage");
366
367                         w.UserNameLabelText = "msg";
368                         Assert.AreEqual ("msg", w.UserNameLabelText, "Assign UserNameLabelText");
369                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate UserNameLabelText");
370
371                         w.UserNameRequiredErrorMessage = "msg";
372                         Assert.AreEqual ("msg", w.UserNameRequiredErrorMessage, "Assign UserNameRequiredErrorMessage");
373                         Assert.AreEqual (++count, w.StateBag.Count, "Viewstate UserNameRequiredErrorMessage");
374
375
376
377                 }
378
379                 public static void BasicRenderTestInit (Page p)
380                 {
381                         CreateTestControl (p);
382                 }
383
384                 public static CreateUserWizard CreateTestControl (Page p)
385                 {
386                         LiteralControl lcb = new LiteralControl (HtmlDiff.BEGIN_TAG);
387                         LiteralControl lce = new LiteralControl (HtmlDiff.END_TAG);
388
389                         CreateUserWizard w = new CreateUserWizard ();
390                         w.ID = "CreateUserWizard1";
391
392                         CreateUserWizardStep step1 = new CreateUserWizardStep ();
393                         CompleteWizardStep step2 = new CompleteWizardStep ();
394
395                         w.MembershipProvider = "FakeProvider";
396                         w.WizardSteps.Add (step1);
397                         w.WizardSteps.Add (step2);
398
399                         p.Form.Controls.Add (lcb);
400                         p.Form.Controls.Add (w);
401                         p.Form.Controls.Add (lce);
402
403                         //p.ClientScript.RegisterForEventValidation (w.ID);
404
405                         return w;
406                 }
407
408                 [Test]
409                 [Category ("NunitWeb")]
410                 public void BasicRenderTest ()
411                 {
412                         string html = new WebTest (PageInvoker.CreateOnLoad (
413                                 new PageDelegate (BasicRenderTestInit))).Run ();
414
415                         int st = 0;
416                         Assert.IsTrue ((st = html.IndexOf ("<table", st)) > 0, "base render test 1");
417                         Assert.IsTrue ((st = html.IndexOf ("CreateUserWizard1", st)) > 0, "base render test 2");
418                         Assert.IsTrue ((st = html.IndexOf ("border-collapse:collapse", st)) > 0, "base render test 3");
419                         Assert.IsTrue ((st = html.IndexOf ("<table", st)) > 0, "base render test 4");
420                         Assert.IsTrue ((st = html.IndexOf ("height:100%", st)) > 0, "base render test 5");
421                         Assert.IsTrue ((st = html.IndexOf ("Sign Up for Your New Account", st)) > 0, "base render test 6");
422                         Assert.IsTrue ((st = html.IndexOf ("UserName", st)) > 0, "base render test 7");
423                         Assert.IsTrue ((st = html.IndexOf ("User Name:", st)) > 0, "base render test 8");
424                         Assert.IsTrue ((st = html.IndexOf ("UserName", st)) > 0, "base render test 9");
425                         Assert.IsTrue ((st = html.IndexOf ("Password", st)) > 0, "base render test 10");
426                         Assert.IsTrue ((st = html.IndexOf ("Password:", st)) > 0, "base render test 11");
427                         Assert.IsTrue ((st = html.IndexOf ("Password", st)) > 0, "base render test 12");
428                         Assert.IsTrue ((st = html.IndexOf ("ConfirmPassword", st)) > 0, "base render test 13");
429                         Assert.IsTrue ((st = html.IndexOf ("Confirm Password:", st)) > 0, "base render test 14");
430                         Assert.IsTrue ((st = html.IndexOf ("ConfirmPassword", st)) > 0, "base render test 15");
431                         Assert.IsTrue ((st = html.IndexOf ("Email", st)) > 0, "base render test 16");
432                         Assert.IsTrue ((st = html.IndexOf ("E-mail:", st)) > 0, "base render test 17");
433                         Assert.IsTrue ((st = html.IndexOf ("Email", st)) > 0, "base render test 18");
434                         Assert.IsTrue ((st = html.IndexOf ("Question", st)) > 0, "base render test 19");
435                         Assert.IsTrue ((st = html.IndexOf ("Security Question:", st)) > 0, "base render test 20");
436                         Assert.IsTrue ((st = html.IndexOf ("Question", st)) > 0, "base render test 21");
437                         Assert.IsTrue ((st = html.IndexOf ("Answer", st)) > 0, "base render test 22");
438                         Assert.IsTrue ((st = html.IndexOf ("Security Answer:", st)) > 0, "base render test 23");
439                         Assert.IsTrue ((st = html.IndexOf ("Answer", st)) > 0, "base render test 24");
440                         Assert.IsTrue ((st = html.IndexOf ("<input", st)) > 0, "base render test 25");
441                         Assert.IsTrue ((st = html.IndexOf ("submit", st)) > 0, "base render test 26");
442                         Assert.IsTrue ((st = html.IndexOf ("NextButton", st)) > 0, "base render test 27");
443                 }
444
445                 [Test]
446                 [Category ("NunitWeb")]
447                 public void TitlesRenderTest ()
448                 {
449                         string html = new WebTest (PageInvoker.CreateOnLoad (
450                                 new PageDelegate (TitlesRenderTestInit))).Run ();
451
452                         Assert.IsTrue (html.IndexOf ("userid") > 0, "UserNameLabelText");
453                         Assert.IsTrue (html.IndexOf ("pincode") > 0, "PasswordLabelText");
454                         Assert.IsTrue (html.IndexOf ("cpincode") > 0, "ConfirmPasswordLabelText");
455                         Assert.IsTrue (html.IndexOf ("zzxcmnmncx") > 0, "QuestionLabelText");
456                         Assert.IsTrue (html.IndexOf ("kjkjskjkjskjkj") > 0, "AnswerLabelText");
457                         Assert.IsTrue (html.IndexOf ("emailemail") > 0, "EmailLabelText");
458                 }
459
460                 public static void TitlesRenderTestInit (Page p)
461                 {
462                         CreateUserWizard w = CreateTestControl (p);
463                         w.UserNameLabelText = "userid";
464                         w.PasswordLabelText = "pincode";
465                         w.ConfirmPasswordLabelText = "cpincode";
466                         w.QuestionLabelText = "zzxcmnmncx";
467                         w.AnswerLabelText = "kjkjskjkjskjkj";
468                         w.EmailLabelText = "emailemail";
469                 }
470
471                 [Test]
472                 [Category ("NunitWeb")]
473                 public void ExtraTitlesRenderTest ()
474                 {
475                         string html = new WebTest (PageInvoker.CreateOnLoad (
476                                 new PageDelegate (ExtraTitlesRenderTestInit))).Run ();
477
478                         Assert.IsTrue (html.IndexOf ("PasswordHintText") > 0, "PasswordHintText");
479                         Assert.IsTrue (html.IndexOf ("InstructionText") > 0, "InstructionText");
480                         Assert.IsTrue (html.IndexOf ("http://www.HelpPageUrl.com") > 0, "HelpPageUrl");
481                         Assert.IsTrue (html.IndexOf ("HelpPageText") > 0, "HelpPageText");
482                         Assert.IsTrue (html.IndexOf ("http://www.HelpPageIconUrl.com") > 0, "HelpPageIconUrl");
483                         Assert.IsTrue (html.IndexOf ("CreateUserButtonText") > 0, "CreateUserButtonText");
484                         Assert.IsTrue (html.IndexOf ("CreateUserStep.Title") > 0, "CreateUserStep.Title");
485                 }
486
487                 public static void ExtraTitlesRenderTestInit (Page p)
488                 {
489                         CreateUserWizard w = CreateTestControl (p);
490                         w.PasswordHintText = "PasswordHintText";
491                         w.InstructionText = "InstructionText";
492                         w.HelpPageUrl = "http://www.HelpPageUrl.com";
493                         w.HelpPageText = "HelpPageText";
494                         w.HelpPageIconUrl = "http://www.HelpPageIconUrl.com";
495                         w.CreateUserStep.Title = "CreateUserStep.Title";
496                         w.CreateUserButtonText = "CreateUserButtonText";
497                 }
498
499                 [Test]
500                 [Category ("NunitWeb")]
501                 public void StylesRenderTest ()
502                 {
503                         string html = new WebTest (PageInvoker.CreateOnLoad (
504                                 new PageDelegate (StylesRenderTestInit))).Run ();
505
506                         Assert.IsTrue (html.IndexOf ("LightGoldenrodYellow;") > 0, "TextBoxStyle");
507                         Assert.IsTrue (html.LastIndexOf ("LightGoldenrodYellow;") > html.IndexOf ("LightGoldenrodYellow;"), "TextBoxStyle2");
508                         Assert.IsTrue (html.IndexOf ("732px") > 0, "TitleTextStyle");
509                         Assert.IsTrue (html.IndexOf ("LightSkyBlue;") > 0, "HyperLinkStyle");
510                         Assert.IsTrue (html.IndexOf ("MediumSeaGreen;") > 0, "InstructionTextStyle");
511                         Assert.IsTrue (html.IndexOf ("MediumSpringGreen;") > 0, "LabelStyle");
512                         Assert.IsTrue (html.IndexOf ("MintCream;") > 0, "PasswordHintStyle");
513                         Assert.IsTrue (html.IndexOf ("PeachPuff;") > 0, "CreateUserButtonStyle");
514
515                 }
516
517                 private string GetDecoratedId (string html, string id)
518                 {
519                         Regex reg = new Regex ("name=\".*[\\$\\:_]" + id + "\"");
520                         Match match = reg.Match (html);
521
522                         string fixedId = match.Value;
523                         if (fixedId.Length > 0)
524                                 fixedId = fixedId.Substring (fixedId.IndexOf ("\""), fixedId.Length - fixedId.IndexOf ("\"")).Trim ('\"');
525
526                         return fixedId;
527                 }
528
529                 private static string GetEventTarget (string html, string id)
530                 {
531                         Regex reg = new Regex ("__doPostBack.*\\(.*'.*" + id + "'");
532                         Match match = reg.Match (html);
533
534                         string fixedId = match.Value;
535                         if (fixedId.Length > 0)
536                                 fixedId = fixedId.Substring (fixedId.IndexOf ("'"), fixedId.Length - fixedId.IndexOf ("'")).Trim ('\'');
537
538                         return fixedId;
539                 }
540
541                 [Test]
542                 [Category ("NunitWeb")]
543                 public void BasicPostbackTest ()
544                 {
545                         PageInvoker pi = PageInvoker.CreateOnLoad (new PageDelegate (StylesRenderTestInit));
546                         WebTest test = new WebTest (pi);
547
548                         string html = test.Run ();
549                         test.Invoker = pi;
550
551                         FormRequest fr = new FormRequest (test.Response, "form1");
552
553                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "UserName"), "username"));
554                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Password"), "password"));
555                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "ConfirmPassword"), "password"));
556                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Email"), "email"));
557                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Question"), "question"));
558                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Answer"), "answer"));
559
560                         PageDelegates pd = new PageDelegates ();
561                         pd.PreRender = new PageDelegate (BasicPostTestPreRender);
562                         pd.Load = new PageDelegate (StylesRenderTestInit);
563                         pi.Delegates = pd;
564
565                         test.Request = fr;
566                         html = test.Run ();
567
568                         Assert.IsTrue (html.IndexOf ("username") > 0, "rendered user name");
569                         Assert.IsTrue (html.IndexOf ("password") > 0, "rendered user password");
570                         Assert.IsTrue (html.IndexOf ("password") > 0, "rendered user confirm password");
571                         Assert.IsTrue (html.IndexOf ("email") > 0, "rendered user email");
572                         Assert.IsTrue (html.IndexOf ("question") > 0, "rendered user question");
573                         Assert.IsTrue (html.IndexOf ("answer") > 0, "rendered user answer");
574
575                         Assert.IsTrue (html.IndexOf ("LightGoldenrodYellow;") > 0, "TextBoxStyle");
576                         Assert.IsTrue (html.LastIndexOf ("LightGoldenrodYellow;") > html.IndexOf ("LightGoldenrodYellow;"), "TextBoxStyle2");
577                         Assert.IsTrue (html.IndexOf ("732px") > 0, "TitleTextStyle");
578                         Assert.IsTrue (html.IndexOf ("LightSkyBlue;") > 0, "HyperLinkStyle");
579                         Assert.IsTrue (html.IndexOf ("MediumSeaGreen;") > 0, "InstructionTextStyle");
580                         Assert.IsTrue (html.IndexOf ("MediumSpringGreen;") > 0, "LabelStyle");
581                         Assert.IsTrue (html.IndexOf ("MintCream;") > 0, "PasswordHintStyle");
582                         Assert.IsTrue (html.IndexOf ("PeachPuff;") > 0, "CreateUserButtonStyle");
583                 }
584
585                 public static void BasicPostTestPreRender (Page p)
586                 {
587                         CreateUserWizard w = (CreateUserWizard) p.FindControl ("CreateUserWizard1");
588                         if (w == null)
589                                 Assert.Fail ("postback1");
590
591                         Assert.AreEqual ("username", w.UserName, "posted user name");
592                         Assert.AreEqual ("password", w.Password, "posted user password");
593                         Assert.AreEqual ("password", w.ConfirmPassword, "posted user confirm password");
594                         Assert.AreEqual ("email", w.Email, "posted user email");
595                         Assert.AreEqual ("question", w.Question, "posted user question");
596                         Assert.AreEqual ("answer", w.Answer, "posted user answer");
597
598                 }
599
600                 public static void StylesRenderTestInit (Page p)
601                 {
602                         CreateUserWizard w = CreateTestControl (p);
603
604                         if (!p.IsPostBack) {
605                                 w.TextBoxStyle.BackColor = Color.LightGoldenrodYellow;
606                                 w.TitleTextStyle.Height = Unit.Pixel (732);
607                                 w.LabelStyle.BackColor = Color.MediumSpringGreen;
608
609                                 w.HelpPageUrl = "http://www.HelpPageUrl.com";
610                                 w.HelpPageText = "hhh";
611                                 w.HyperLinkStyle.BackColor = Color.LightSkyBlue;
612
613                                 w.InstructionText = "text";
614                                 w.InstructionTextStyle.BackColor = Color.MediumSeaGreen;
615
616                                 w.PasswordHintText = "pwdhint";
617                                 w.PasswordHintStyle.BackColor = Color.MintCream;
618
619                                 w.CreateUserButtonStyle.BackColor = Color.PeachPuff;
620
621                                 w.ContinueButtonType = ButtonType.Image;
622                                 w.ContinueButtonStyle.Width = Unit.Pixel (321);
623                                 w.ContinueButtonImageUrl = "http://localhost/abc.gif";
624
625                                 w.CompleteSuccessTextStyle.BackColor = Color.Violet;
626                                 w.CompleteSuccessText = "user created";
627                         }
628                 }
629
630                 // TODO:
631                 // ValidatorTextStyle
632                 // ErrorMessageStyle
633                 [Test]
634                 [Category ("NunitWeb")]
635                 public void CreateUserTest ()
636                 {
637                         PageInvoker pi = PageInvoker.CreateOnLoad (new PageDelegate (StylesRenderTestInit));
638                         WebTest test = new WebTest (pi);
639
640                         string html = test.Run ();
641                         test.Invoker = pi;
642
643                         FormRequest fr = new FormRequest (test.Response, "form1");
644
645                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "UserName"), "username"));
646                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Password"), "password"));
647                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "ConfirmPassword"), "password"));
648                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Email"), "email"));
649                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Question"), "question"));
650                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Answer"), "answer"));
651                         string button = GetDecoratedId (html, "StepNextButtonButton");
652                         if (button.Length > 0)
653                                 fr.Controls.Add (new BaseControl (GetDecoratedId (html, "StepNextButtonButton"), "Create User"));
654                         else
655                                 fr.Controls.Add (new BaseControl ("__EVENTTARGET", GetEventTarget (html, "StartNextButton")));
656
657                         test.Request = fr;
658                         html = test.Run ();
659
660                         Assert.IsTrue (html.IndexOf ("Complete") > 0, "Create User");
661                         Assert.IsTrue (html.IndexOf ("type=\"image\"") > 0, "ContinueButtonType");
662                         Assert.IsTrue (html.IndexOf ("321px") > 0, "ContinueButtonStyle");
663                         Assert.IsTrue (html.IndexOf ("http://localhost/abc.gif") > 0, "ContinueButtonImageUrl");
664                         Assert.IsTrue (html.IndexOf ("Violet") > 0, "CompleteSuccessTextStyle");
665                         Assert.IsTrue (html.IndexOf ("user created") > 0, "CompleteSuccessText");
666                 }
667
668
669                 [Test]
670                 [Category ("NunitWeb")]
671                 public void ButtonsRenderTest ()
672                 {
673                         string html = new WebTest (PageInvoker.CreateOnLoad (
674                                 new PageDelegate (ButtonsRenderTestInit))).Run ();
675
676                         Assert.IsTrue (html.IndexOf ("Pink;") > 0, "CreateUserButtonStyle");
677                         Assert.IsTrue (html.IndexOf ("14px") > 0, "CreateUserButtonStyle");
678                         Assert.IsTrue (html.IndexOf ("CreateUserButtonText") > 0, "CreateUserButtonText");
679                 }
680
681                 public static void ButtonsRenderTestInit (Page p)
682                 {
683                         CreateUserWizard w = CreateTestControl (p);
684                         w.CreateUserButtonStyle.BorderColor = Color.Pink;
685                         w.CreateUserButtonStyle.BorderWidth = Unit.Pixel (14);
686                         w.CreateUserButtonType = ButtonType.Link;
687                         w.CreateUserButtonText = "CreateUserButtonText";
688                 }
689
690                 [Test]
691                 [Category ("NunitWeb")]
692                 public void ErrorMsgTest ()
693                 {
694                         PageInvoker pi = PageInvoker.CreateOnLoad (new PageDelegate (ErrorMsgTestInit));
695                         WebTest test = new WebTest (pi);
696
697                         string html = test.Run ();
698                         test.Invoker = pi;
699
700                         FormRequest fr = new FormRequest (test.Response, "form1");
701                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "UserName"), "duplicate"));
702                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Password"), "123"));
703                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "ConfirmPassword"), "123"));
704                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Email"), "123"));
705                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Question"), "123"));
706                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Answer"), "123"));
707                         string button = GetDecoratedId (html, "StepNextButtonButton");
708                         if (button.Length > 0)
709                                 fr.Controls.Add (new BaseControl (button, "Create User"));
710                         else
711                                 fr.Controls.Add (new BaseControl ("__EVENTTARGET", GetEventTarget (html, "StartNextButton")));
712
713                         test.Request = fr;
714                         html = test.Run ();
715
716                         Assert.IsTrue (html.IndexOf ("duplicateuser") > 0, "duplicateuser");
717
718                         test.Invoker = pi;
719                         fr = new FormRequest (test.Response, "form1");
720                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "UserName"), "incorrect"));
721                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Password"), "123"));
722                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "ConfirmPassword"), "123"));
723                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Email"), "123"));
724                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Question"), "123"));
725                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Answer"), "123"));
726                         button = GetDecoratedId (html, "StepNextButtonButton");
727                         if (button.Length > 0)
728                                 fr.Controls.Add (new BaseControl (button, "Create User"));
729                         else
730                                 fr.Controls.Add (new BaseControl ("__EVENTTARGET", GetEventTarget (html, "StartNextButton")));
731
732                         test.Request = fr;
733                         html = test.Run ();
734
735                         Assert.IsTrue (html.IndexOf ("unknown") > 0, "unknown");
736
737                         test.Invoker = pi;
738                         fr = new FormRequest (test.Response, "form1");
739                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "UserName"), "123"));
740                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Password"), "incorrect"));
741                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "ConfirmPassword"), "incorrect"));
742                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Email"), "123"));
743                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Question"), "123"));
744                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Answer"), "123"));
745                         button = GetDecoratedId (html, "StepNextButtonButton");
746                         if (button.Length > 0)
747                                 fr.Controls.Add (new BaseControl (button, "Create User"));
748                         else
749                                 fr.Controls.Add (new BaseControl ("__EVENTTARGET", GetEventTarget (html, "StartNextButton")));
750
751                         test.Request = fr;
752                         html = test.Run ();
753
754                         Assert.IsTrue (html.IndexOf ("invpwd") > 0, "invpwd");
755
756                         test.Invoker = pi;
757                         fr = new FormRequest (test.Response, "form1");
758                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "UserName"), "123"));
759                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Password"), "123"));
760                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "ConfirmPassword"), "123"));
761                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Email"), "incorrect"));
762                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Question"), "123"));
763                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Answer"), "123"));
764                         button = GetDecoratedId (html, "StepNextButtonButton");
765                         if (button.Length > 0)
766                                 fr.Controls.Add (new BaseControl (button, "Create User"));
767                         else
768                                 fr.Controls.Add (new BaseControl ("__EVENTTARGET", GetEventTarget (html, "StartNextButton")));
769
770                         test.Request = fr;
771                         html = test.Run ();
772
773                         Assert.IsTrue (html.IndexOf ("invemail") > 0, "invemail");
774
775                         test.Invoker = pi;
776                         fr = new FormRequest (test.Response, "form1");
777                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "UserName"), "123"));
778                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Password"), "123"));
779                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "ConfirmPassword"), "123"));
780                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Email"), "duplicate"));
781                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Question"), "123"));
782                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Answer"), "123"));
783                         button = GetDecoratedId (html, "StepNextButtonButton");
784                         if (button.Length > 0)
785                                 fr.Controls.Add (new BaseControl (button, "Create User"));
786                         else
787                                 fr.Controls.Add (new BaseControl ("__EVENTTARGET", GetEventTarget (html, "StartNextButton")));
788
789                         test.Request = fr;
790                         html = test.Run ();
791
792                         Assert.IsTrue (html.IndexOf ("duplicateemail") > 0, "duplicateemail");
793
794                         test.Invoker = pi;
795                         fr = new FormRequest (test.Response, "form1");
796                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "UserName"), "123"));
797                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Password"), "123"));
798                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "ConfirmPassword"), "123"));
799                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Email"), "123"));
800                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Question"), "incorrect"));
801                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Answer"), "123"));
802                         button = GetDecoratedId (html, "StepNextButtonButton");
803                         if (button.Length > 0)
804                                 fr.Controls.Add (new BaseControl (button, "Create User"));
805                         else
806                                 fr.Controls.Add (new BaseControl ("__EVENTTARGET", GetEventTarget (html, "StartNextButton")));
807
808                         test.Request = fr;
809                         html = test.Run ();
810
811                         Assert.IsTrue (html.IndexOf ("invquestion") > 0, "invquestion");
812
813                         test.Invoker = pi;
814                         fr = new FormRequest (test.Response, "form1");
815                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "UserName"), "123"));
816                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Password"), "123"));
817                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "ConfirmPassword"), "123"));
818                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Email"), "123"));
819                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Question"), "123"));
820                         fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Answer"), "incorrect"));
821                         button = GetDecoratedId (html, "StepNextButtonButton");
822                         if (button.Length > 0)
823                                 fr.Controls.Add (new BaseControl (button, "Create User"));
824                         else
825                                 fr.Controls.Add (new BaseControl ("__EVENTTARGET", GetEventTarget (html, "StartNextButton")));
826
827                         test.Request = fr;
828                         html = test.Run ();
829
830                         Assert.IsTrue (html.IndexOf ("invanswer") > 0, "invanswer");
831                 }
832
833                 public static void ErrorMsgTestInit (Page p)
834                 {
835                         CreateUserWizard w = CreateTestControl (p);
836
837                         if (!p.IsPostBack) {
838                                 w.AnswerRequiredErrorMessage = "answerreq";
839                                 w.ConfirmPasswordCompareErrorMessage = "passwordconfirm";
840                                 w.ConfirmPasswordRequiredErrorMessage = "passwordconfreq";
841                                 w.DuplicateEmailErrorMessage = "duplicateemail";
842                                 w.DuplicateUserNameErrorMessage = "duplicateuser";
843                                 w.EmailRequiredErrorMessage = "emailreq";
844                                 w.InvalidAnswerErrorMessage = "invanswer";
845                                 w.InvalidEmailErrorMessage = "invemail";
846                                 w.InvalidPasswordErrorMessage = "invpwd";
847                                 w.InvalidQuestionErrorMessage = "invquestion";
848                                 w.PasswordRequiredErrorMessage = "pwdreq";
849                                 w.QuestionRequiredErrorMessage = "questreq";
850                                 w.UserNameRequiredErrorMessage = "userreq";
851                                 w.UnknownErrorMessage = "unknown";
852                         }
853                 }
854
855                 [Test]
856                 public void BibbleEvent_ContinueButtonCommand () {
857                         TestCreateUserWizard w = new TestCreateUserWizard ();
858                         w.ContinueButtonClick+=new EventHandler(w_ContinueButtonClick);
859                         w.FinishButtonClick += new WizardNavigationEventHandler (w_FinishButtonClick);
860                         _ContinueButtonClickFlag = false;
861                         _FinishButtonClickFlag = false;
862
863                         CommandEventArgs continueCommandArg = new CommandEventArgs (CreateUserWizard.ContinueButtonCommandName, null);
864                         Assert.AreEqual (true, w.DoOnBubbleEvent (continueCommandArg), "Bubble Event#1");
865                         Assert.AreEqual (true, _ContinueButtonClickFlag, "Bubble Event#2");
866                         Assert.AreEqual (false, _FinishButtonClickFlag, "Bubble Event#3");
867                 }
868
869                 bool _ContinueButtonClickFlag;
870                 bool _FinishButtonClickFlag;
871
872                 void w_ContinueButtonClick (object sender, EventArgs e) {
873                         _ContinueButtonClickFlag = true;
874                 }
875
876                 void w_FinishButtonClick (object sender, WizardNavigationEventArgs e) {
877                         _FinishButtonClickFlag = true;
878                 }
879         }
880 }
881
882 #endif