2 // Tests for System.Web.UI.WebControls.WebParts.PartTest
5 // Chris Toshok (toshok@novell.com)
9 // Copyright (C) 2005 Novell, Inc (http://www.novell.com)
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34 using NUnit.Framework;
35 using System.Web.UI.WebControls;
36 using System.Web.UI.WebControls.WebParts;
38 namespace MonoTests.System.Web.UI.WebControls.WebParts {
41 public class WebPartTest {
42 class Poker : WebPart {
43 public void TrackState ()
48 public object SaveState ()
50 return SaveViewState();
53 public void LoadState (object o)
60 [Category ("NotWorking")]
61 public void Defaults ()
63 Poker p = new Poker ();
65 Assert.AreEqual (p.AllowClose, true, "A1");
66 Assert.AreEqual (p.AllowConnect, true, "A2");
67 Assert.AreEqual (p.AllowEdit, true, "A3");
68 Assert.AreEqual (p.AllowHide, true, "A4");
69 Assert.AreEqual (p.AllowMinimize, true, "A5");
70 Assert.AreEqual (p.AllowZoneChange, true, "A6");
71 Assert.AreEqual (p.AuthorizationFilter, String.Empty, "A7");
72 Assert.AreEqual (p.CatalogIconImageUrl, String.Empty, "A8");
73 Assert.AreEqual (p.ChromeState, PartChromeState.Normal, "A9");
74 Assert.AreEqual (p.ChromeType, PartChromeType.Default, "A10");
75 Assert.AreEqual (p.ConnectErrorMessage, String.Empty, "A11");
76 Assert.AreEqual (p.Description, String.Empty, "A12");
78 Assert.AreEqual (p.DisplayTitle, "Untitled", "A14");
79 Assert.AreEqual (p.ExportMode, WebPartExportMode.None, "A15");
80 Assert.AreEqual (p.HasSharedData, false, "A16");
81 Assert.AreEqual (p.HasUserData, false, "A17");
82 Assert.AreEqual (p.Height, Unit.Empty, "A18");
83 Assert.AreEqual (p.HelpMode, WebPartHelpMode.Navigate, "A19");
84 Assert.AreEqual (p.HelpUrl, String.Empty, "A20");
85 Assert.AreEqual (p.Hidden, false, "A21");
86 Assert.AreEqual (p.ImportErrorMessage, "Cannot import this Web Part.", "A22");
87 Assert.AreEqual (p.IsClosed, false, "A23");
88 Assert.AreEqual (p.IsShared, false, "A24");
89 Assert.AreEqual (p.IsStandalone, true, "A25");
90 /* this next isn't really a default - it's true
91 * because the part was created programmatically */
92 Assert.AreEqual (p.IsStatic, true, "A26");
93 Assert.AreEqual (p.Subtitle, String.Empty, "A27");
94 Assert.AreEqual (p.Title, String.Empty, "A28");
95 Assert.AreEqual (p.TitleIconImageUrl, String.Empty, "A29");
96 Assert.AreEqual (p.TitleUrl, String.Empty, "A30");
97 Assert.IsNotNull (p.Verbs, "A31");
98 #if IWebEditableInterface
99 Assert.AreEqual (p.WebBrowsableObject, null, "A32");
102 Assert.AreEqual (p.WebPartManager, null, "A33");
104 Assert.AreEqual (p.Width, Unit.Empty, "A34");
105 Assert.AreEqual (p.ZoneIndex, 0, "A35");