Added free new tests foe wizard subclasses : WizardStepTest.cs; WizardStepCollection...
authorYoni Klain <yonik@mono-cvs.ximian.com>
Sun, 16 Jul 2006 11:46:44 +0000 (11:46 -0000)
committerYoni Klain <yonik@mono-cvs.ximian.com>
Sun, 16 Jul 2006 11:46:44 +0000 (11:46 -0000)
WizardStepBase including embedded resource WizardTest.skin

svn path=/trunk/mcs/; revision=62651

mcs/class/System.Web/ChangeLog
mcs/class/System.Web/Makefile
mcs/class/System.Web/System.Web_test.dll.sources
mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
mcs/class/System.Web/Test/System.Web.UI.WebControls/WizardStepBaseTest.cs [new file with mode: 0644]
mcs/class/System.Web/Test/System.Web.UI.WebControls/WizardStepCollectionTest.cs [new file with mode: 0644]
mcs/class/System.Web/Test/System.Web.UI.WebControls/WizardStepTest.cs [new file with mode: 0644]
mcs/class/System.Web/Test/mainsoft/NunitWebResources/WizardTest.skin [new file with mode: 0644]

index 6939e653e542a2ae5c85f7796058c5a4bba4fa83..0b1cda9fbe34a2121cf56e44c330a7b98bbee25e 100644 (file)
@@ -1,3 +1,9 @@
+2006-07-16 Yoni Klain <yonik@mainsoft.com>
+
+       * System.Web_test.dll.sources: add WizardStepBaseTest.cs; WizardStepTest.cs; WizardStepCollectionTest.cs
+       * Makefile: add Test/mainsoft/NunitWebResources/WizardTest.skin
+       resource for WizardStepBase_Theme 
+
 2006-07-09 Yoni Klain <yonik@mainsoft.com>
 
        * Makefile: add Test/mainsoft/NunitWebResources/PostBackMenuTest.aspx
index 52f5a54c1efb42a8c8f92075f5365f3cb1c2d7f2..bd1d1098f1fa9be8e819fcbc92e28402c3cb86fa 100644 (file)
@@ -83,6 +83,7 @@ TEST_RESOURCE_FILES = \
        Test/mainsoft/NunitWebResources/UrlProperty.ascx \
        Test/mainsoft/NunitWebResources/UrlProperty.ascx.cs \
        Test/mainsoft/NunitWebResources/Web.sitemap \
+       Test/mainsoft/NunitWebResources/WizardTest.skin \
        Test/mainsoft/MainsoftWebTest/nunitweb_config.xml 
 
 NUNIT_RESOURCE_FILES = $(TEST_RESOURCE_FILES)
index 8ec1abcc2bb2fc7f82561a62029eaa94be3ab38b..d6838a0390f0542f83f4f141792cfa46d937094e 100644 (file)
@@ -230,6 +230,9 @@ System.Web.UI.WebControls/ViewTest.cs
 System.Web.UI.WebControls/WebColorConverterTest.cs
 System.Web.UI.WebControls/WebControlTest.cs
 System.Web.UI.WebControls/WizardTest.cs
+System.Web.UI.WebControls/WizardStepBaseTest.cs
+System.Web.UI.WebControls/WizardStepCollectionTest.cs
+System.Web.UI.WebControls/WizardStepTest.cs
 System.Web.UI.WebControls/XmlTest.cs
 System.Web.UI.WebControls/XmlDataSourceTest.cs
 System.Web.UI.WebControls/SiteMapDataSourceTest.cs
index 468fa2853703bde2d7ae1ea467445cc1a1d58eaa..54cd260bab4d5d8e41a941eae6612a189b029f11 100644 (file)
@@ -1,3 +1,7 @@
+2006-07-16 Yoni Klain <yonik@mainsoft.com>
+
+       * added WizardStepBaseTest.cs; WizardStepTest.cs; WizardStepCollectionTest.cs
+       
 2006-07-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
 
        * DataListTest.cs: new test for templated items. Patch by JarosÅ‚aw
diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/WizardStepBaseTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/WizardStepBaseTest.cs
new file mode 100644 (file)
index 0000000..aaa22cc
--- /dev/null
@@ -0,0 +1,421 @@
+//
+// Tests for System.Web.UI.WebControls.WizardStepBaseTest.cs
+//
+// Author:
+//     Yoni Klein (yonik@mainsoft.com)
+//
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+#if NET_2_0
+
+using System;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using NUnit.Framework;
+using System.IO;
+using MonoTests.stand_alone.WebHarness;
+using MonoTests.SystemWeb.Framework;
+using System.Collections;
+
+namespace MonoTests.System.Web.UI.WebControls
+{
+       public class PokerWizardStepBase : WizardStepBase
+       {
+                       // View state Stuff
+               public PokerWizardStepBase ()
+                       : base ()
+               {
+                       TrackViewState ();
+               }
+
+               public object SaveState ()
+               {
+                       return SaveViewState ();
+               }
+
+               public void LoadState (object o)
+               {
+                       LoadViewState (o);
+               }
+
+               public StateBag StateBag
+               {
+                       get { return base.ViewState; }
+               }
+
+               public void DoOnLoad (EventArgs e)
+               {
+                       base.OnLoad (e);
+               }
+
+               public string RenderChildren ()
+               {
+                       StringWriter sw = new StringWriter ();
+                       sw.NewLine = "\n";
+                       HtmlTextWriter writer = new HtmlTextWriter (sw);
+                       base.RenderChildren (writer);
+                       return writer.InnerWriter.ToString ();
+               }
+
+       }
+
+       [TestFixture]
+       public class WizardStepBaseTest
+       {
+               private bool event_checker;
+
+               [Test]
+               public void WizardStepBase_DefaultProperty ()
+               {
+                       PokerWizardStepBase step = new PokerWizardStepBase ();
+                       Assert.AreEqual (true, step.AllowReturn, "AllowReturn");
+                       Assert.AreEqual (true, step.EnableTheming, "EnableTheming");
+                       Assert.AreEqual (null, step.ID, "ID");
+                       Assert.AreEqual (WizardStepType.Auto, step.StepType, "StepType");
+                       Assert.AreEqual ("", step.Title, "Title");
+                       Assert.AreEqual (null, step.Wizard, "Wizard");
+               }
+
+               [Test]
+               [Category("NotWorking")]
+               public void WizardStepBase_DefaultPropertyNotWorking ()
+               {
+                       PokerWizardStepBase step = new PokerWizardStepBase ();
+                       Assert.AreEqual (null, step.Name, "Name");
+               }
+
+
+               [Test]
+               public void WizardStepBase_AssignProperty ()
+               {
+                       PokerWizardStepBase step = new PokerWizardStepBase ();
+                       Wizard w = new Wizard ();
+                       Assert.AreEqual (0, step.StateBag.Count, "ViewState.Count");
+
+                       w.WizardSteps.Add (step);
+                       Assert.AreEqual (w, step.Wizard, "Wizard");
+
+                       step.EnableTheming = false;
+                       Assert.AreEqual (false, step.EnableTheming, "EnableTheming");
+
+                       step.ID = "test";
+                       Assert.AreEqual ("test", step.ID, "ID");
+
+                       step.Title = "test";
+                       Assert.AreEqual ("test", step.Title, "Title");
+
+                       step.AllowReturn = false;
+                       Assert.AreEqual (false, step.AllowReturn, "AllowReturn");
+
+                       step.StepType = WizardStepType.Complete;
+                       Assert.AreEqual (WizardStepType.Complete, step.StepType, "StepType");
+               }
+
+               [Test]
+               public void WizardStepBase_StateBag ()
+               {
+                       PokerWizardStepBase step = new PokerWizardStepBase ();
+                       Wizard w = new Wizard ();
+                       step.StepType = WizardStepType.Complete;
+                       Assert.AreEqual (WizardStepType.Complete, step.StepType, "StepType");
+                       Assert.AreEqual (1, step.StateBag.Count, "StepTypeStateBag");
+
+                       step.AllowReturn = false;
+                       Assert.AreEqual (false, step.AllowReturn, "AllowReturn");
+                       Assert.AreEqual (2, step.StateBag.Count, "AllowReturnStateBag");
+
+                       step.Title = "test";
+                       Assert.AreEqual ("test", step.Title, "Title");
+                       Assert.AreEqual (3, step.StateBag.Count, "Title");
+               }
+
+               [Test]
+               public void WizardStepBase_LoadViewState ()
+               {
+                       PokerWizardStepBase step = new PokerWizardStepBase ();
+                       PokerWizardStepBase copy = new PokerWizardStepBase ();
+                       step.AllowReturn = false;
+                       Assert.AreEqual (false, step.AllowReturn, "AllowReturn");
+                       Assert.AreEqual (1, step.StateBag.Count, "AllowReturnStateBag");
+
+                       step.StepType = WizardStepType.Complete;
+                       Assert.AreEqual (WizardStepType.Complete, step.StepType, "StepType");
+                       Assert.AreEqual (2, step.StateBag.Count, "StepTypeStateBag");
+
+                       object state = step.SaveState ();
+                       copy.LoadState (state);
+                       Assert.AreEqual (false, copy.AllowReturn, "AllowReturn");
+                       Assert.AreEqual (WizardStepType.Complete, copy.StepType, "StepType");
+               }
+
+               [Test]
+               public void WizardStepBase_LoadEvent ()
+               {
+                       Wizard w = new Wizard ();
+                       PokerWizardStepBase step = new PokerWizardStepBase ();
+                       w.WizardSteps.Add (step);
+                       step.Load += new EventHandler (eventchecker);
+                       step.DoOnLoad (new EventArgs ());
+                       eventassert ("OnLoadEvent");
+               }
+
+               [Test]
+               public void WizardStepBase_RenderChildren ()
+               {
+                       Wizard w = new Wizard ();
+                       PokerWizardStepBase step = new PokerWizardStepBase ();
+                       LiteralControl lc = new LiteralControl ("test");
+                       step.Controls.Add (lc);
+                       w.WizardSteps.Add (step);
+                       Assert.AreEqual ("test", step.RenderChildren (), "RenderChildren");
+               }
+
+               [Test]
+               public void WizardStepBase_ID ()
+               {
+                       Wizard w = new Wizard ();
+                       PokerWizardStepBase step = new PokerWizardStepBase ();
+                       step.ID = "step1";
+                       w.WizardSteps.Add (step);
+                       Assert.AreEqual (step, w.FindControl ("step1"), "Step with ID fail");
+               }
+                       
+               
+               
+               [Test]
+               [Category ("NunitWeb")]
+               [Category ("NotWorking")]
+               public void WizardStepBase_RenderTest ()
+               {
+                       // This render test include Title property test 
+                       string html = new WebTest (PageInvoker.CreateOnLoad (
+                               new PageDelegate (Render_Test))).Run ();
+                       string origin = @"<table cellspacing=""0"" cellpadding=""0"" border=""0"" style=""border-collapse:collapse;"">
+                                       <tr>
+                                       <td style=""height:100%;""><a href=""#ctl01_SkipLink""><img alt=""Skip Navigation Links."" height=""0"" width=""0"" src=""/NunitWeb/WebResource.axd?d=gZrz8lvSQfolS1pG07HX9g2&amp;t=632784640484505569"" style=""border-width:0px;"" /></a><table id=""ctl01_SideBarContainer_SideBarList"" cellspacing=""0"" border=""0"" style=""border-collapse:collapse;"">
+                                               <tr>
+                                                       <td style=""font-weight:bold;""><a id=""ctl01_SideBarContainer_SideBarList_ctl00_SideBarButton"" href=""javascript:__doPostBack('ctl01$SideBarContainer$SideBarList$ctl00$SideBarButton','')"">my_title</a></td>
+                                               </tr>
+                                       </table><a id=""ctl01_SkipLink""></a></td><td style=""height:100%;""><table cellspacing=""0"" cellpadding=""0"" border=""0"" style=""height:100%;width:100%;border-collapse:collapse;"">
+                                               <tr style=""height:100%;"">
+                                                       <td>123</td>
+                                               </tr><tr>
+                                                       <td align=""right""><table cellspacing=""5"" cellpadding=""5"" border=""0"">
+                                                               <tr>
+                                                                       <td align=""right""><input type=""submit"" name=""ctl01$StartNavigationTemplateContainerID$StartNextButton"" value=""Next"" id=""ctl01_StartNavigationTemplateContainerID_StartNextButton"" /></td>
+                                                               </tr>
+                                               </table></td>
+                                       </tr>
+                                       </table>";
+                       HtmlDiff.AssertAreEqual (origin, HtmlDiff.GetControlFromPageHtml (html), "BaseRender");
+                       if (html.IndexOf ("my_title") < 0) {
+                               Assert.Fail ("WizardStepBase title not rendered");
+                       }
+                       
+               }
+
+               public static void Render_Test (Page p)
+               {
+                       LiteralControl lcb = new LiteralControl (HtmlDiff.BEGIN_TAG);
+                       LiteralControl lce = new LiteralControl (HtmlDiff.END_TAG);
+
+                       Wizard w = new Wizard ();
+                       PokerWizardStepBase ws = new PokerWizardStepBase ();
+                       ws.Title = "my_title";
+                       ws.Controls.Add (new LiteralControl ("123"));
+                       ws.StepType = WizardStepType.Start;
+                       w.DisplaySideBar = true;
+                       w.WizardSteps.Add (ws);
+                       p.Form.Controls.Add (lcb);
+                       p.Form.Controls.Add (w);
+                       p.Form.Controls.Add (lce);
+               }
+
+               [Test]
+               [Category ("NunitWeb")]
+               [Category ("NotWorking")]
+               public void WizardStepBase_PostBackAllowReturnTest ()
+               {
+                       // This test examine the rendering 2 steps and make postbake
+                       // assigned AllowReturn property 
+
+                       WebTest t = new WebTest ();
+                       PageDelegates pd = new PageDelegates ();
+                       pd.PreInit = _postback;
+                       pd.PreRenderComplete = read_control;
+                       t.Invoker = new PageInvoker (pd);
+                       string result = t.Run ();
+                       if (result.IndexOf ("Start") < 0)
+                               Assert.Fail ("Rendering fault");
+
+                       ArrayList list = t.UserData as ArrayList;
+                       Assert.IsNotNull (list, "PostBackDataNotCreated");
+
+                       FormRequest fr = new FormRequest (t.Response, "form1");
+                       fr.Controls.Add ("__EVENTTARGET");
+                       fr.Controls.Add ("__EVENTARGUMENT");
+
+                       fr.Controls["__EVENTTARGET"].Value = list[1].ToString ();
+                       fr.Controls["__EVENTARGUMENT"].Value = "";
+
+                       t.Request = fr;
+                       result = t.Run ();
+                       if (result.IndexOf ("StepType") < 0)
+                               Assert.Fail ("MovedToStep1");
+                       if (result.IndexOf ("Previous") > 0) {
+                               Assert.Fail ("Previous button rendered");
+                       }
+               }
+
+               public static void _postback (Page p)
+               {
+                       p.EnableEventValidation = false;
+                       Wizard w = new Wizard ();
+                       w.ID = "Wizard";
+
+                       PokerWizardStepBase ws = new PokerWizardStepBase ();
+                       ws.ID = "step";
+                       ws.StepType = WizardStepType.Start;
+                       ws.Controls.Add (new LiteralControl ("StartType"));
+                       ws.AllowReturn = false;
+
+                       PokerWizardStepBase ws1 = new PokerWizardStepBase ();
+                       ws1.ID = "step1";
+                       ws1.StepType = WizardStepType.Step;
+                       ws1.Controls.Add (new LiteralControl ("StepType"));
+
+                       w.DisplaySideBar = true;
+                       w.WizardSteps.Add (ws);
+                       w.WizardSteps.Add (ws1);
+                       p.Controls.Add (w);
+               }
+
+               [Test]
+               [Category ("NunitWeb")]
+               [Category ("NotWorking")]
+               public void WizardStepBase_Theme ()
+               {
+#if DOT_NET
+                       WebTest.CopyResource (GetType (), "MonoTests.System.Web.UI.WebControls.Resources.WizardTest.skin", "App_Themes/Theme1/WizardTest.skin");
+#else
+                       WebTest.CopyResource (GetType (), "WizardTest.skin", "App_Themes/Theme1/WizardTest.skin");
+#endif
+                       WebTest t = new WebTest ();
+                       PageDelegates pd = new PageDelegates ();
+                       pd.PreInit = set_properties;
+                       pd.Load = theme;
+                       t.Invoker = new PageInvoker (pd);
+                       string html = t.Run ();
+                       if (html.IndexOf ("testing") < 0) {
+                               Assert.Fail ("WizardStepBase themes not applyed when EnableTheming = true");
+                       }
+                       pd.Load = notheme;
+                       t.Invoker = new PageInvoker (pd);
+                       html = t.Run ();
+                       if (html.IndexOf ("testing") > 0) {
+                               Assert.Fail ("WizardStepBase themes applyed when EnableTheming = false");
+                       }
+               }
+
+               public static void set_properties (Page p)
+               {
+                       p.Theme = "Theme1";
+               }
+
+               public static void theme (Page p)
+               {
+                       Wizard w = new Wizard ();
+                       PokerWizardStepBase ws = new PokerWizardStepBase ();
+                       ws.Controls.Add (new Button ());
+                       ws.EnableTheming = true;
+                       ws.SkinID = "WizardTest";
+                       w.WizardSteps.Add (ws);
+                       p.Form.Controls.Add (w);
+               }
+
+               public static void notheme (Page p)
+               {
+                       Wizard w = new Wizard ();
+                       PokerWizardStepBase ws = new PokerWizardStepBase ();
+                       ws.Controls.Add (new Button ());
+                       ws.EnableTheming = false;
+                       ws.SkinID = "WizardTest";
+                       w.WizardSteps.Add (ws);
+                       p.Form.Controls.Add (w);
+               }
+
+               [Test]
+               [Category ("NotWorking")]
+               [ExpectedException (typeof (NullReferenceException))]
+               public void WizardStepBase_RenderChildrenException ()
+               {
+                       PokerWizardStepBase step = new PokerWizardStepBase ();
+                       LiteralControl lc = new LiteralControl ("test");
+                       step.Controls.Add (lc);
+                       step.RenderChildren ();
+               }
+
+               [Test]
+               [Category ("NotWorking")]
+               [ExpectedException(typeof(InvalidOperationException))]
+               public void WizardStepBase_LoadEventException ()
+               {
+                       PokerWizardStepBase step = new PokerWizardStepBase ();
+                       step.Load += new EventHandler (eventchecker);
+                       step.DoOnLoad (new EventArgs());
+               }
+
+               private void eventchecker (object o, EventArgs e)
+               {
+                       event_checker = true;
+               }
+
+               private void eventassert (string message)
+               {
+                       Assert.IsTrue (event_checker, message);
+                       event_checker = false;
+               }
+
+               public static void read_control (Page p)
+               {
+                       ArrayList list = new ArrayList ();
+                       recurcive_find (list, typeof (LinkButton), p.FindControl ("Wizard").FindControl ("SideBarContainer"));
+                       WebTest.CurrentTest.UserData = list;
+               }
+
+               public static void recurcive_find (ArrayList list, Type t, Control control)
+               {
+                       foreach (Control c in control.Controls) {
+                               if (c == null)
+                                       continue;
+                               if (t == c.GetType ()) {
+                                       list.Add (c.UniqueID);
+                               }
+                               recurcive_find (list, t, c);
+                       }
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/WizardStepCollectionTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/WizardStepCollectionTest.cs
new file mode 100644 (file)
index 0000000..620c1d6
--- /dev/null
@@ -0,0 +1,241 @@
+//
+// Tests for System.Web.UI.WebControls.WizardStepCollectionTest.cs
+//
+// Author:
+//     Yoni Klein (yonik@mainsoft.com)
+//
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+#if NET_2_0
+
+using System;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using NUnit.Framework;
+using System.Collections;
+
+namespace MonoTests.System.Web.UI.WebControls
+{
+       [TestFixture]
+       public class WizardStepCollectionTest
+       {
+               
+               [Test]
+               public void WizardStepCollection_DefaultProperty ()
+               {
+                       Wizard w = new Wizard();
+                       Assert.AreEqual (typeof (WizardStepCollection), w.WizardSteps.GetType (), "WizardStepCollection");
+                       Assert.AreEqual (0,w.WizardSteps.Count, "Count");
+                       Assert.AreEqual (false, w.WizardSteps.IsReadOnly, "IsReadOnly");
+                       Assert.AreEqual (false, w.WizardSteps.IsSynchronized, "IsSynchronized");
+                       Assert.AreEqual (w.WizardSteps, w.WizardSteps.SyncRoot, "SyncRoot");
+               }
+
+               [Test]
+               public void WizardStepCollection_Add ()
+               {
+                       Wizard w = new Wizard ();
+                       WizardStep step1 = new WizardStep ();
+                       try {
+                               w.WizardSteps.Add (step1);
+                       }
+                       catch (Exception e) {
+                               Assert.Fail (e.Message);
+                       }
+                       Assert.AreEqual (1, w.WizardSteps.Count, "Add step fail");
+               }
+
+               [Test]
+               public void WizardStepCollection_AddAt ()
+               {
+                       Wizard w = new Wizard ();
+                       WizardStep step1 = new WizardStep ();
+                       WizardStep step2 = new WizardStep ();
+
+                       try {
+                               w.WizardSteps.Add (step1);
+                               w.WizardSteps.AddAt (0, step2);
+                       }
+                       catch (Exception e) {
+                               Assert.Fail (e.Message);
+                       }
+                       Assert.AreEqual (2, w.WizardSteps.Count, "Step count fail");
+                       Assert.AreEqual (step2, w.WizardSteps[0], "Step index fail");
+               }
+
+               public void WizardStepCollection_Clear ()
+               {
+                       Wizard w = new Wizard ();
+                       WizardStep step1 = new WizardStep ();
+                       WizardStep step2 = new WizardStep ();
+
+                       try {
+                               w.WizardSteps.Add (step1);
+                               w.WizardSteps.Add (step2);
+                       }
+                       catch (Exception e) {
+                               Assert.Fail (e.Message);
+                       }
+                       Assert.AreEqual (2, w.WizardSteps.Count, "Step count fail");
+                       w.WizardSteps.Clear ();
+                       Assert.AreEqual (0, w.WizardSteps.Count, "Step clear fail");
+               }
+
+               [Test]
+               public void WizardStepCollection_Contains ()
+               {
+                       Wizard w = new Wizard ();
+                       WizardStep step1 = new WizardStep ();
+                       WizardStep step2 = new WizardStep ();
+
+                       try {
+                               w.WizardSteps.Add (step1);
+                       }
+                       catch (Exception e) {
+                               Assert.Fail (e.Message);
+                       }
+                       Assert.AreEqual (1, w.WizardSteps.Count, "Step count fail");
+                       Assert.AreEqual (true, w.WizardSteps.Contains (step1), "Step contains fail#1");
+                       Assert.AreEqual (false, w.WizardSteps.Contains (step2), "Step contains fail#2");
+               }
+
+               [Test]
+               public void WizardStepCollection_CopyTo ()
+               {
+                       Wizard w = new Wizard ();
+                       WizardStep step1 = new WizardStep ();
+                       WizardStep step2 = new WizardStep ();
+                       
+
+                       try {
+                               w.WizardSteps.Add (step1);
+                               w.WizardSteps.Add (step2);
+                       }
+                       catch (Exception e) {
+                               Assert.Fail (e.Message);
+                       }
+                       Assert.AreEqual (2, w.WizardSteps.Count, "Step count fail");
+                       WizardStep[] steps = new WizardStep [w.WizardSteps.Count] ;
+                       w.WizardSteps.CopyTo (steps, 0);
+                       Assert.AreEqual (2, steps.GetLength (0), "Copyto elements count");
+                       Assert.AreEqual (step1, steps[0], "Copyto elements equal#1");
+                       Assert.AreEqual (step2, steps[1], "Copyto elements equal#2");
+               }
+
+               [Test]
+               public void WizardStepCollection_GetEnumerator ()
+               {
+                       Wizard w = new Wizard ();
+                       WizardStep step1 = new WizardStep ();
+                       WizardStep step2 = new WizardStep ();
+
+
+                       try {
+                               w.WizardSteps.Add (step1);
+                               w.WizardSteps.Add (step2);
+                       }
+                       catch (Exception e) {
+                               Assert.Fail (e.Message);
+                       }
+                       Assert.AreEqual (2, w.WizardSteps.Count, "Step count fail");
+                       IEnumerator numerator = w.WizardSteps.GetEnumerator ();
+                       numerator.Reset();
+                       numerator.MoveNext ();
+                       Assert.AreEqual (step1, numerator.Current, "Enumerator item value#1");
+                       numerator.MoveNext ();
+                       Assert.AreEqual (step2, numerator.Current, "Enumerator item value#2");
+               }
+
+               [Test]
+               public void WizardStepCollection_Insert ()
+               {
+                       Wizard w = new Wizard ();
+                       WizardStep step1 = new WizardStep ();
+                       WizardStep step2 = new WizardStep ();
+
+                       try {
+                               w.WizardSteps.Add (step1);
+                               w.WizardSteps.Insert (0, step2);
+                       }
+                       catch (Exception e) {
+                               Assert.Fail (e.Message);
+                       }
+                       Assert.AreEqual (2, w.WizardSteps.Count, "Step count fail");
+                       Assert.AreEqual (step2, w.WizardSteps[0], "Step index fail");
+               }
+
+               [Test]
+               public void WizardStepCollection_Remove ()
+               {
+                       Wizard w = new Wizard ();
+                       WizardStep step1 = new WizardStep ();
+                       WizardStep step2 = new WizardStep ();
+
+                       try {
+                               w.WizardSteps.Add (step1);
+                               w.WizardSteps.Add (step2);
+                       }
+                       catch (Exception e) {
+                               Assert.Fail (e.Message);
+                       }
+                       Assert.AreEqual (2, w.WizardSteps.Count, "Step count before remove fail");
+                       try {
+                               w.WizardSteps.Remove (step1);
+                               w.WizardSteps.Remove (step2);
+                       }
+                       catch (Exception e) {
+                               Assert.Fail (e.Message);
+                       }
+                       Assert.AreEqual (0, w.WizardSteps.Count, "Step count after remove fail");
+               }
+
+               [Test]
+               public void WizardStepCollection_RemoveAt ()
+               {
+                       Wizard w = new Wizard ();
+                       WizardStep step1 = new WizardStep ();
+                       WizardStep step2 = new WizardStep ();
+
+                       try {
+                               w.WizardSteps.Add (step1);
+                               w.WizardSteps.Add (step2);
+                       }
+                       catch (Exception e) {
+                               Assert.Fail (e.Message);
+                       }
+                       Assert.AreEqual (2, w.WizardSteps.Count, "Step count before removeat fail");
+                       try {
+                               w.WizardSteps.RemoveAt (0);
+                               
+                       }
+                       catch (Exception e) {
+                               Assert.Fail (e.Message);
+                       }
+                       Assert.AreEqual (1, w.WizardSteps.Count, "Step count after removeat fail");
+                       Assert.AreEqual (step2, w.WizardSteps[0], "Item value after remove");
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/WizardStepTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/WizardStepTest.cs
new file mode 100644 (file)
index 0000000..58f0938
--- /dev/null
@@ -0,0 +1,47 @@
+//
+// Tests for System.Web.UI.WebControls.WizardStepTest.cs
+//
+// Author:
+//     Yoni Klein (yonik@mainsoft.com)
+//
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+#if NET_2_0
+
+using System;
+using NUnit.Framework;
+
+namespace MonoTests.System.Web.UI.WebControls
+{
+       
+       [TestFixture]
+       public class WizardStepTest
+       {
+               // Represents a basic step that is displayed in a Wizard control. 
+               // This class cannot be inherited.
+               // All Public Properties ,Public Methods ,Public Events ,Protected Methods 
+               // are inherited from base and tested on base classes.
+       }
+}
+#endif
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWebResources/WizardTest.skin b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/WizardTest.skin
new file mode 100644 (file)
index 0000000..2c5c03d
--- /dev/null
@@ -0,0 +1,16 @@
+<%--\r
+Default skin template. The following skins are provided as examples only.\r
+\r
+1. Named control skin. The SkinId should be uniquely defined because\r
+   duplicate SkinId's per control type are not allowed in the same theme.\r
+\r
+<asp:GridView runat="server" SkinId="gridviewSkin" BackColor="White" >\r
+   <AlternatingRowStyle BackColor="Blue" />\r
+</asp:GridView>\r
+\r
+2. Default skin. The SkinId is not defined. Only one default \r
+   control skin per control type is allowed in the same theme.\r
+\r
+<asp:Image runat="server" ImageUrl="~/images/image1.jpg" />\r
+--%>\r
+<asp:Button runat="server" Text="testing" />\r