Author: krasnov
Date: 2006-06-28 11:27:08 -0400 (Wed, 28 Jun 2006)
New Revision: 62114

Added:
   trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/WizardTest.cs
Modified:
   trunk/mcs/class/System.Web/ChangeLog
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/Wizard.cs
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/WizardStepCollection.cs
   trunk/mcs/class/System.Web/System.Web_test.dll.sources
   trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
   trunk/mcs/class/System.Web/Test/mainsoft/MainsoftWebTest/ChangeLog
   trunk/mcs/class/System.Web/Test/mainsoft/MainsoftWebTest/nunitweb_config.xml
Log:
* System.Web_test.dll.sources: added WizardTest.cs
* WizardStepCollection.cs: Fixed Add methods to initialize WizardStep.Wizard 
property
* Wizard.cs: Fixed ActiveStepIndex, it should be -1 if there no steps 
Fixed GetStepType, if only one step present, it should be FinishStep
Fixed styles of tables for more accurate rendering, fixed Wizard buttons order
* nunitweb_config.xml: filtered onclick for input tags
* Added WizardTest.cs: Wizard control basic tests

Modified: trunk/mcs/class/System.Web/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/ChangeLog        2006-06-28 15:18:22 UTC (rev 
62113)
+++ trunk/mcs/class/System.Web/ChangeLog        2006-06-28 15:27:08 UTC (rev 
62114)
@@ -1,3 +1,7 @@
+2006-06-28 Vladimir Krasnov <[EMAIL PROTECTED]>
+
+       * System.Web_test.dll.sources: added WizardTest.cs
+
 2006-06-26  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * System.Web.dll.sources : added NullableStringValidator.cs.

Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog      
2006-06-28 15:18:22 UTC (rev 62113)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog      
2006-06-28 15:27:08 UTC (rev 62114)
@@ -1,3 +1,12 @@
+2006-06-28  Vladimir Krasnov  <[EMAIL PROTECTED]>
+
+       * WizardStepCollection.cs: Fixed Add methods to initialize
+       WizardStep.Wizard property
+       * Wizard.cs: Fixed ActiveStepIndex, it should be -1 if there no steps
+       Fixed GetStepType, if only one step present, it should be FinishStep
+       Fixed styles of tables for more accurate rendering, fixed Wizard 
+       buttons order
+
 2006-06-28     Konstantin Triger <[EMAIL PROTECTED]>
 
        * FormView.cs: instantiate correct template when the bounding data 
source is

Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/Wizard.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/Wizard.cs      
2006-06-28 15:18:22 UTC (rev 62113)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/Wizard.cs      
2006-06-28 15:27:08 UTC (rev 62114)
@@ -200,6 +200,9 @@
            [ThemeableAttribute (false)]
                public virtual int ActiveStepIndex {
                        get {
+                               if (WizardSteps.Count == 0)
+                                       return -1;
+
                                return activeStepIndex;
                        }
                        set {
@@ -808,10 +811,10 @@
                public WizardStepType GetStepType (WizardStepBase wizardStep, 
int index)
                {
                        if (wizardStep.StepType == WizardStepType.Auto) {
-                               if (index == 0)
+                               if (index == WizardSteps.Count - 1)
+                                       return WizardStepType.Finish;
+                               else if (index == 0)
                                        return WizardStepType.Start;
-                               else if (index == WizardSteps.Count - 1)
-                                       return WizardStepType.Finish;
                                else
                                        return WizardStepType.Step;
                        } else
@@ -852,6 +855,7 @@
                        wizardTable = new Table ();
                        wizardTable.CellPadding = CellPadding; 
                        wizardTable.CellSpacing = CellSpacing; 
+                       wizardTable.ID = this.ID;
                        
                        AddHeaderRow (wizardTable);
                        
@@ -868,13 +872,13 @@
                        
                        RegisterApplyStyle (viewCell, StepStyle);
                        viewCell.Controls.Add (multiView);
-                       
-                       viewCell.Height = new Unit ("100%");
                        viewRow.Cells.Add (viewCell);
+                       viewRow.Height = new Unit ("100%");
                        wizardTable.Rows.Add (viewRow);
                        
                        TableRow buttonRow = new TableRow ();
                        TableCell buttonCell = new TableCell ();
+                       buttonCell.HorizontalAlign = HorizontalAlign.Right;
                        CreateButtonBar (buttonCell);
                        buttonRow.Cells.Add (buttonCell);
                        wizardTable.Rows.Add (buttonRow);
@@ -889,6 +893,7 @@
                                TableRow row = new TableRow ();
                                
                                TableCell sideBarCell = new TableCell ();
+                               sideBarCell.ControlStyle.Height = 
Unit.Percentage (100);
                                CreateSideBar (sideBarCell);
                                row.Cells.Add (sideBarCell);
                                
@@ -907,6 +912,8 @@
                void CreateButtonBar (TableCell buttonBarCell)
                {
                        Table t = new Table ();
+                       t.CellPadding = 5;
+                       t.CellSpacing = 5;
                        TableRow row = new TableRow ();
                        RegisterApplyStyle (buttonBarCell, NavigationStyle);
                        
@@ -916,33 +923,33 @@
                                        if (startNavigationTemplate != null) {
                                                AddTemplateCell (row, 
startNavigationTemplate, StartNextButtonID, CancelButtonID);
                                        } else {
+                                               if (AllowNavigationToStep 
(ActiveStepIndex + 1))
+                                                       AddButtonCell (row, 
CreateButton (StartNextButtonID, MoveNextCommandName, StartNextButtonType, 
StartNextButtonText, StartNextButtonImageUrl, StartNextButtonStyle));
                                                if (DisplayCancelButton)
                                                        AddButtonCell (row, 
CreateButton (CancelButtonID, CancelCommandName, CancelButtonType, 
CancelButtonText, CancelButtonImageUrl, CancelButtonStyle));
-                                               if (AllowNavigationToStep 
(ActiveStepIndex + 1))
-                                                       AddButtonCell (row, 
CreateButton (StartNextButtonID, MoveNextCommandName, StartNextButtonType, 
StartNextButtonText, StartNextButtonImageUrl, StartNextButtonStyle));
                                        }
                                        break;
                                case WizardStepType.Step:
                                        if (stepNavigationTemplate != null) {
                                                AddTemplateCell (row, 
stepNavigationTemplate, StepPreviousButtonID, StepNextButtonID, CancelButtonID);
                                        } else {
-                                               if (DisplayCancelButton)
-                                                       AddButtonCell (row, 
CreateButton (CancelButtonID, CancelCommandName, CancelButtonType, 
CancelButtonText, CancelButtonImageUrl, CancelButtonStyle));
                                                if (AllowNavigationToStep 
(ActiveStepIndex - 1))
                                                        AddButtonCell (row, 
CreateButton (StepPreviousButtonID, MovePreviousCommandName, 
StepPreviousButtonType, StepPreviousButtonText, StepPreviousButtonImageUrl, 
StepPreviousButtonStyle));
                                                if (AllowNavigationToStep 
(ActiveStepIndex + 1))
                                                        AddButtonCell (row, 
CreateButton (StepNextButtonID, MoveNextCommandName, StepNextButtonType, 
StepNextButtonText, StepNextButtonImageUrl, StepNextButtonStyle));
+                                               if (DisplayCancelButton)
+                                                       AddButtonCell (row, 
CreateButton (CancelButtonID, CancelCommandName, CancelButtonType, 
CancelButtonText, CancelButtonImageUrl, CancelButtonStyle));
                                        }
                                        break;
                                case WizardStepType.Finish:
                                        if (finishNavigationTemplate != null) {
                                                AddTemplateCell (row, 
finishNavigationTemplate, FinishPreviousButtonID, FinishButtonID, 
CancelButtonID);
                                        } else {
-                                               if (DisplayCancelButton)
-                                                       AddButtonCell (row, 
CreateButton (CancelButtonID, CancelCommandName, CancelButtonType, 
CancelButtonText, CancelButtonImageUrl, CancelButtonStyle));
                                                if (AllowNavigationToStep 
(ActiveStepIndex - 1))
                                                        AddButtonCell (row, 
CreateButton (FinishPreviousButtonID, MovePreviousCommandName, 
FinishPreviousButtonType, FinishPreviousButtonText, 
FinishPreviousButtonImageUrl, FinishPreviousButtonStyle));
                                                AddButtonCell (row, 
CreateButton (FinishButtonID, MoveCompleteCommandName, 
FinishCompleteButtonType, FinishCompleteButtonText, 
FinishCompleteButtonImageUrl, FinishCompleteButtonStyle));
+                                               if (DisplayCancelButton)
+                                                       AddButtonCell (row, 
CreateButton (CancelButtonID, CancelCommandName, CancelButtonType, 
CancelButtonText, CancelButtonImageUrl, CancelButtonStyle));
                                        }
                                        break;
                        }
@@ -976,6 +983,7 @@
                void AddButtonCell (TableRow row, Control control)
                {
                        TableCell cell = new TableCell ();
+                       cell.HorizontalAlign = HorizontalAlign.Right;
                        cell.Controls.Add (control);
                        row.Cells.Add (cell);
                }
@@ -992,6 +1000,7 @@
                        } else {
                                stepDatalist = new DataList ();
                                stepDatalist.ID = DataListID;
+                               stepDatalist.CellSpacing = 0;
                                sideBarCell.Controls.Add (stepDatalist);
                        }
 

Modified: 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/WizardStepCollection.cs
===================================================================
--- 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/WizardStepCollection.cs    
    2006-06-28 15:18:22 UTC (rev 62113)
+++ 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/WizardStepCollection.cs    
    2006-06-28 15:27:08 UTC (rev 62114)
@@ -68,6 +68,7 @@
                public void Add (WizardStepBase wizardStep)
                {
                        if (wizardStep == null) throw new ArgumentNullException 
("wizardStep");
+                       wizardStep.SetWizard (wizard);
                        list.Add (wizardStep);
                        wizard.UpdateViews ();
                }
@@ -75,6 +76,7 @@
                public void AddAt (int index, WizardStepBase wizardStep)
                {
                        if (wizardStep == null) throw new ArgumentNullException 
("wizardStep");
+                       wizardStep.SetWizard (wizard);
                        list.Insert (index, wizardStep);
                        wizard.UpdateViews ();
                }

Modified: trunk/mcs/class/System.Web/System.Web_test.dll.sources
===================================================================
--- trunk/mcs/class/System.Web/System.Web_test.dll.sources      2006-06-28 
15:18:22 UTC (rev 62113)
+++ trunk/mcs/class/System.Web/System.Web_test.dll.sources      2006-06-28 
15:27:08 UTC (rev 62114)
@@ -222,6 +222,7 @@
 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/XmlTest.cs
 System.Web.UI.WebControls/XmlDataSourceTest.cs
 System.Web.UI.WebControls/SiteMapDataSourceTest.cs

Modified: trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog 
2006-06-28 15:18:22 UTC (rev 62113)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog 
2006-06-28 15:27:08 UTC (rev 62114)
@@ -1,3 +1,7 @@
+2006-06-28 Vladimir Krasnov <[EMAIL PROTECTED]>
+
+       * Added WizardTest.cs: Wizard control basic tests
+
 2006-06-25 Yoni Klain <[EMAIL PROTECTED]>
 
        * GridViewTest.cs;

Added: trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/WizardTest.cs
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/WizardTest.cs     
2006-06-28 15:18:22 UTC (rev 62113)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/WizardTest.cs     
2006-06-28 15:27:08 UTC (rev 62114)
@@ -0,0 +1,328 @@
+//
+// WizardTest.cs - Unit tests for System.Web.UI.WebControls.Wizard
+//
+// Author:
+//     Vladimir Krasnov  <[EMAIL PROTECTED]>
+//
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.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.Collections;
+using System.IO;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using MonoTests.SystemWeb.Framework;
+using MonoTests.stand_alone.WebHarness;
+
+using NUnit.Framework;
+
+namespace MonoTests.System.Web.UI.WebControls {
+
+       public class NavTemplate : ITemplate
+       {
+               public void InstantiateIn (Control container)
+               {
+                       Button b = new Button();
+                       b.ID = "NavTemplateButton";
+                       b.Text = "Next";
+
+                       container.Controls.Add (b);
+                       
+               }
+       }
+
+       public class TestWizard : Wizard {
+
+               public string Tag {
+                       get { return base.TagName; }
+               }
+
+               public StateBag StateBag {
+                       get { return base.ViewState; }
+               }
+
+               public string Render ()
+               {
+                       StringWriter sw = new StringWriter ();
+                       sw.NewLine = "\n";
+                       HtmlTextWriter writer = new HtmlTextWriter (sw);
+                       base.Render (writer);
+                       return writer.InnerWriter.ToString ();
+               }
+
+               public Style GetStyle ()
+               {
+                       return base.CreateControlStyle ();
+               }
+
+               public void TrackState ()
+               {
+                       TrackViewState ();
+               }
+
+               public void LoadState (object state)
+               {
+                       LoadViewState (state);
+               }
+
+               public object SaveState ()
+               {
+                       return SaveViewState ();
+               }
+
+               public void SetDesignMode (IDictionary dic)
+               {
+                       base.SetDesignModeState (dic);
+               }
+
+               private bool onBubble;
+
+               public bool OnBubbleEventCalled {
+                       get { return onBubble; }
+                       set { onBubble = value; }
+               }
+
+               protected override bool OnBubbleEvent (object source, EventArgs 
e)
+               {
+                       onBubble = true;
+                       return base.OnBubbleEvent (source, e);
+               }
+
+               public bool DoBubbleEvent (object source, EventArgs e)
+               {
+                       return base.OnBubbleEvent (source, e);
+               }
+
+               public void DoEnsureChildControls ()
+               {
+                       base.EnsureChildControls ();
+               } 
+       }
+
+       [TestFixture]
+       public class WizardTest {
+
+               private HtmlTextWriter GetWriter ()
+               {
+                       StringWriter sw = new StringWriter ();
+                       sw.NewLine = "\n";
+                       return new HtmlTextWriter (sw);
+               }
+
+               [Test]
+               public void ReadOnlyFields ()
+               {
+                       Assert.AreEqual ("Cancel", Wizard.CancelCommandName, 
"CancelCommandName");
+                       Assert.AreEqual ("MoveComplete", 
Wizard.MoveCompleteCommandName, "MoveCompleteCommandName");
+                       Assert.AreEqual ("MoveNext", 
Wizard.MoveNextCommandName, "MoveNextCommandName");
+                       Assert.AreEqual ("MovePrevious", 
Wizard.MovePreviousCommandName, "MovePreviousCommandName");
+                       Assert.AreEqual ("Move", Wizard.MoveToCommandName, 
"MoveToCommandName");
+               }
+
+               [Test]
+               public void DefaultProperties ()
+               {
+                       TestWizard w = new TestWizard ();
+                       Assert.AreEqual (0, w.Attributes.Count, 
"Attributes.Count");
+                       Assert.AreEqual (0, w.StateBag.Count, 
"ViewState.Count");
+                       Assert.AreEqual (-1, w.ActiveStepIndex, 
"ActiveStepIndex");
+                       Assert.AreEqual (String.Empty, w.CancelButtonImageUrl, 
"CancelButtonImageUrl");
+                       Assert.AreEqual ("Cancel", w.CancelButtonText, 
"CancelButtonText");
+                       Assert.AreEqual (ButtonType.Button, w.CancelButtonType, 
"CancelButtonType");
+                       Assert.AreEqual (String.Empty, 
w.CancelDestinationPageUrl, "CancelDestinationPageUrl");
+                       Assert.IsFalse (w.DisplayCancelButton, 
"DisplayCancelButton");
+                       Assert.IsTrue (w.DisplaySideBar, "DisplaySideBar");
+                       Assert.AreEqual (0, w.CellPadding, "CellPadding");
+                       Assert.AreEqual (0, w.CellSpacing, "CellSpacing");
+                       Assert.AreEqual (String.Empty, 
w.FinishCompleteButtonImageUrl, "FinishCompleteButtonImageUrl");
+                       Assert.AreEqual ("Finish", w.FinishCompleteButtonText, 
"FinishCompleteButtonText");
+                       Assert.AreEqual (ButtonType.Button, 
w.FinishCompleteButtonType, "FinishCompleteButtonType");
+                       Assert.AreEqual (String.Empty, 
w.FinishDestinationPageUrl, "FinishDestinationPageUrl");
+                       Assert.AreEqual (String.Empty, 
w.FinishPreviousButtonImageUrl, "FinishPreviousButtonImageUrl");
+                       Assert.AreEqual ("Previous", 
w.FinishPreviousButtonText, "FinishPreviousButtonText");
+                       Assert.AreEqual (ButtonType.Button, 
w.FinishPreviousButtonType, "FinishPreviousButtonType");
+                       Assert.AreEqual (String.Empty, 
w.StartNextButtonImageUrl, "StartNextButtonImageUrl");
+                       Assert.AreEqual ("Next", w.StartNextButtonText, 
"StartNextButtonText");
+                       Assert.AreEqual (ButtonType.Button, 
w.StartNextButtonType, "StartNextButtonType");
+                       Assert.AreEqual (String.Empty, 
w.StepNextButtonImageUrl, "StepNextButtonImageUrl");
+                       Assert.AreEqual ("Next", w.StepNextButtonText, 
"StepNextButtonText");
+                       Assert.AreEqual (ButtonType.Button, 
w.StepNextButtonType, "StepNextButtonType");
+                       Assert.AreEqual (String.Empty, 
w.StepPreviousButtonImageUrl, "StepPreviousButtonImageUrl");
+                       Assert.AreEqual ("Previous", w.StepPreviousButtonText, 
"StepPreviousButtonText");
+                       Assert.AreEqual (ButtonType.Button, 
w.StepPreviousButtonType, "StepPreviousButtonType");
+                       Assert.IsNotNull (w.WizardSteps, "WizardSteps");
+
+                       // Styles
+                       Assert.IsNotNull (w.CancelButtonStyle, 
"CancelButtonStyle");
+                       Assert.IsNotNull (w.FinishCompleteButtonStyle, 
"FinishCompleteButtonStyle");
+                       Assert.IsNotNull (w.FinishPreviousButtonStyle, 
"FinishPreviousButtonStyle");
+                       Assert.IsNotNull (w.HeaderStyle, "HeaderStyle");
+                       Assert.IsNotNull (w.NavigationButtonStyle, 
"NavigationButtonStyle");
+                       Assert.IsNotNull (w.NavigationStyle, "NavigationStyle");
+                       Assert.IsNotNull (w.SideBarStyle, "SideBarStyle");
+                       Assert.IsNotNull (w.SideBarButtonStyle, 
"SideBarButtonStyle");
+                       Assert.IsNotNull (w.StartNextButtonStyle, 
"StartNextButtonStyle");
+                       Assert.IsNotNull (w.StepNextButtonStyle, 
"StepNextButtonStyle");
+                       Assert.IsNotNull (w.StepPreviousButtonStyle, 
"StepPreviousButtonStyle");
+                       Assert.IsNotNull (w.StepStyle, "StepStyle");
+
+                       // Templates
+                       Assert.IsNull (w.SideBarTemplate, "SideBarTemplate");
+                       Assert.IsNull (w.HeaderTemplate, "HeaderTemplate");
+                       Assert.IsNull (w.FinishNavigationTemplate, 
"FinishNavigationTemplate");
+                       Assert.IsNull (w.StartNavigationTemplate, 
"StartNavigationTemplate");
+                       Assert.IsNull (w.StepNavigationTemplate, 
"StepNavigationTemplate");
+               }
+
+               [Test]
+               public void AssignToDefaultProperties ()
+               {
+                       TestWizard w = new TestWizard ();
+                       Assert.AreEqual (0, w.Attributes.Count, 
"Attributes.Count");
+                       Assert.AreEqual (0, w.StateBag.Count, 
"ViewState.Count");
+
+                       w.CancelButtonImageUrl = "value";
+                       Assert.AreEqual ("value", w.CancelButtonImageUrl, 
"CancelButtonImageUrl");
+                       Assert.AreEqual (1, w.StateBag.Count, 
"ViewState.Count-1");
+
+                       w.CancelDestinationPageUrl = "value";
+                       Assert.AreEqual ("value", w.CancelDestinationPageUrl, 
"CancelDestinationPageUrl");
+                       Assert.AreEqual (2, w.StateBag.Count, 
"ViewState.Count-2");
+
+                       w.FinishCompleteButtonImageUrl = "value";
+                       Assert.AreEqual ("value", 
w.FinishCompleteButtonImageUrl, "FinishCompleteButtonImageUrl");
+                       Assert.AreEqual (3, w.StateBag.Count, 
"ViewState.Count-3");
+
+                       w.FinishDestinationPageUrl = "value";
+                       Assert.AreEqual ("value", w.FinishDestinationPageUrl, 
"FinishDestinationPageUrl");
+                       Assert.AreEqual (4, w.StateBag.Count, 
"ViewState.Count-4");
+
+                       w.FinishPreviousButtonImageUrl = "value";
+                       Assert.AreEqual ("value", 
w.FinishPreviousButtonImageUrl, "FinishPreviousButtonImageUrl");
+                       Assert.AreEqual (5, w.StateBag.Count, 
"ViewState.Count-5");
+
+                       w.StartNextButtonImageUrl = "value";
+                       Assert.AreEqual ("value", w.StartNextButtonImageUrl, 
"StartNextButtonImageUrl");
+                       Assert.AreEqual (6, w.StateBag.Count, 
"ViewState.Count-6");
+
+                       w.StepNextButtonImageUrl = "value";
+                       Assert.AreEqual ("value", w.StepNextButtonImageUrl, 
"StepNextButtonImageUrl");
+                       Assert.AreEqual (7, w.StateBag.Count, 
"ViewState.Count-7");
+
+                       w.StepPreviousButtonImageUrl = "value";
+                       Assert.AreEqual ("value", w.StepPreviousButtonImageUrl, 
"StepPreviousButtonImageUrl");
+                       Assert.AreEqual (8, w.StateBag.Count, 
"ViewState.Count-8");
+
+                       w.CancelButtonText = "value";
+                       Assert.AreEqual ("value", w.CancelButtonText, 
"CancelButtonText");
+                       Assert.AreEqual (9, w.StateBag.Count, 
"ViewState.Count-9");
+
+                       w.FinishCompleteButtonText = "value";
+                       Assert.AreEqual ("value", w.FinishCompleteButtonText, 
"FinishCompleteButtonText");
+                       Assert.AreEqual (10, w.StateBag.Count, 
"ViewState.Count-10");
+
+                       w.StartNextButtonText = "value";
+                       Assert.AreEqual ("value", w.StartNextButtonText, 
"StartNextButtonText");
+                       Assert.AreEqual (11, w.StateBag.Count, 
"ViewState.Count-11");
+
+                       w.StepNextButtonText = "value";
+                       Assert.AreEqual ("value", w.StepNextButtonText, 
"StepNextButtonText");
+                       Assert.AreEqual (12, w.StateBag.Count, 
"ViewState.Count-12");
+
+                       w.StepPreviousButtonText = "value";
+                       Assert.AreEqual ("value", w.StepPreviousButtonText, 
"StepPreviousButtonText");
+                       Assert.AreEqual (13, w.StateBag.Count, 
"ViewState.Count-13");
+
+                       w.CancelButtonType = ButtonType.Button;
+                       Assert.AreEqual (ButtonType.Button, w.CancelButtonType, 
"CancelButtonType");
+                       Assert.AreEqual (14, w.StateBag.Count, 
"ViewState.Count-14");
+
+                       w.FinishCompleteButtonType = ButtonType.Button;
+                       Assert.AreEqual (ButtonType.Button, 
w.FinishCompleteButtonType, "FinishCompleteButtonType");
+                       Assert.AreEqual (15, w.StateBag.Count, 
"ViewState.Count-15");
+
+                       w.FinishPreviousButtonType = ButtonType.Button;
+                       Assert.AreEqual (ButtonType.Button, 
w.FinishPreviousButtonType, "FinishPreviousButtonType");
+                       Assert.AreEqual (16, w.StateBag.Count, 
"ViewState.Count-16");
+
+                       w.StartNextButtonType = ButtonType.Button;
+                       Assert.AreEqual (ButtonType.Button, 
w.StartNextButtonType, "StartNextButtonType");
+                       Assert.AreEqual (17, w.StateBag.Count, 
"ViewState.Count-17");
+
+                       w.StepNextButtonType = ButtonType.Button;
+                       Assert.AreEqual (ButtonType.Button, 
w.StepNextButtonType, "StepNextButtonType");
+                       Assert.AreEqual (18, w.StateBag.Count, 
"ViewState.Count-18");
+
+                       w.StepPreviousButtonType = ButtonType.Button;
+                       Assert.AreEqual (ButtonType.Button, 
w.StepPreviousButtonType, "StepPreviousButtonType");
+                       Assert.AreEqual (19, w.StateBag.Count, 
"ViewState.Count-19");
+               }
+
+               [Test]
+               public void WizardSteps ()
+               {
+                       TestWizard w = new TestWizard ();
+                       Assert.AreEqual (-1, w.ActiveStepIndex, 
"ActiveStepIndex on no steps");
+
+                       w.WizardSteps.Add (new WizardStep ());
+                       Assert.IsNotNull (w.WizardSteps[0].Wizard, 
"WizardStep.Wizard");
+                       Assert.AreEqual (WizardStepType.Finish, w.GetStepType 
(w.WizardSteps[0], 0), "WizardStepType.Finish");
+               }
+
+               [Test]
+               [Category ("NunitWeb")]
+               public void RenderTest ()
+               {
+                       string html = new WebTest (PageInvoker.CreateOnPreInit(
+                               new PageDelegate (WizardPreInit))).Run();
+
+                       HtmlDiff.AssertAreEqual ("<table cellspacing=\"0\" 
cellpadding=\"0\" border=\"0\" style=\"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=\"ctl02$FinishNavigationTemplateContainerID$FinishButton\" 
value=\"Finish\" id=\"ctl02_FinishNavigationTemplateContainerID_FinishButton\" 
/></td></tr></table></td></tr></table>", HtmlDiff.GetControlFromPageHtml 
(html), "BaseRender");
+               }
+
+               public static void WizardPreInit (Page p)
+               {
+                       LiteralControl lcb = new LiteralControl 
(HtmlDiff.BEGIN_TAG);
+                       LiteralControl lce = new LiteralControl 
(HtmlDiff.END_TAG); 
+
+                       Wizard w = new Wizard ();
+                       WizardStep ws = new WizardStep ();
+                       ws.Controls.Add (new LiteralControl ("123"));
+                       try {
+                               w.SkipLinkText = "";
+                       }
+                       catch (Exception) { }
+                       w.DisplaySideBar = false;
+                       w.WizardSteps.Add (ws);
+                       p.Controls.Add (lcb); 
+                       p.Controls.Add (w);
+                       p.Controls.Add (lce); 
+               }
+
+       
+       }
+}
+
+#endif
\ No newline at end of file

Modified: trunk/mcs/class/System.Web/Test/mainsoft/MainsoftWebTest/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/Test/mainsoft/MainsoftWebTest/ChangeLog  
2006-06-28 15:18:22 UTC (rev 62113)
+++ trunk/mcs/class/System.Web/Test/mainsoft/MainsoftWebTest/ChangeLog  
2006-06-28 15:27:08 UTC (rev 62114)
@@ -1,3 +1,7 @@
+2006-06-28  Vladimir Krasnov  <[EMAIL PROTECTED]>
+
+       * nunitweb_config.xml: filtered onclick for input tags
+
 2006-05-21  Yoni Klain <[EMAIL PROTECTED]>
 
        * XmlComparer.cs: add 2 variable for test fail asserting information

Modified: 
trunk/mcs/class/System.Web/Test/mainsoft/MainsoftWebTest/nunitweb_config.xml
===================================================================
--- 
trunk/mcs/class/System.Web/Test/mainsoft/MainsoftWebTest/nunitweb_config.xml    
    2006-06-28 15:18:22 UTC (rev 62113)
+++ 
trunk/mcs/class/System.Web/Test/mainsoft/MainsoftWebTest/nunitweb_config.xml    
    2006-06-28 15:27:08 UTC (rev 62114)
@@ -2,7 +2,7 @@
        <IgnoreList>
                <div id="" visible="" name="" onmouseover="" onmouseout="" 
style="" />"
                <span id="" visible="" name="" src=""/>
-               <input id="" visible="" name="" __EVENTARGUMENT="" 
__EVENTTARGET="" __VIEWSTATE="" causesvalidation=""/>
+               <input id="" visible="" name="" __EVENTARGUMENT="" 
__EVENTTARGET="" __VIEWSTATE="" causesvalidation="" onclick=""/>
                <table id="" visible="" name=""/>
                <td id="" visible="" name=""/>
                <th id="" visible="" name=""/>

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to