2 // Tests for System.Web.UI.WebControls.Repeater.cs
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.
31 using NUnit.Framework;
34 using System.Globalization;
37 using System.Web.UI.WebControls;
39 namespace MonoTests.System.Web.UI.WebControls
42 public class RepeaterTest {
43 class Poker : Repeater {
45 public void TrackState ()
50 public object SaveState ()
52 return SaveViewState ();
55 public void LoadState (object o)
61 public DataSourceSelectArguments GetSelectArguments()
63 return SelectArguments;
66 public DataSourceSelectArguments DoCreateDataSourceSelectArguments ()
68 return base.CreateDataSourceSelectArguments();
75 public void Repeater_DefaultsSelectArguments ()
77 Poker p = new Poker ();
78 DataSourceSelectArguments args, args2;
80 args = p.GetSelectArguments();
81 args2 = p.DoCreateDataSourceSelectArguments();
83 Assert.AreEqual (args, args2, "call == prop");
85 Assert.IsNotNull (args, "property null check");
86 Assert.IsTrue (args != DataSourceSelectArguments.Empty, "property != Empty check");
87 Assert.IsTrue (args.Equals (DataSourceSelectArguments.Empty), "property but they are empty check");
89 Assert.IsNotNull (args2, "method null check");
90 Assert.IsTrue (args2 != DataSourceSelectArguments.Empty, "method != Empty check");
91 Assert.IsTrue (args2.Equals (DataSourceSelectArguments.Empty), "method but they are empty check");
93 /* check to see whether multiple calls give us different refs */
94 args = p.DoCreateDataSourceSelectArguments();
96 Assert.AreEqual (args, args2, "multiple calls, same ref");