2 // LoginCas.cs - CAS unit tests for System.Web.UI.WebControls.Login
5 // Sebastien Pouliot <sebastien@ximian.com>
7 // Copyright (C) 2005 Novell, Inc (http://www.novell.com)
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:
17 // The above copyright notice and this permission notice shall be
18 // included in all copies or substantial portions of the Software.
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.
31 using NUnit.Framework;
34 using System.Security;
35 using System.Security.Permissions;
37 using System.Web.UI.WebControls;
39 using MonoTests.System.Web.UI.WebControls;
41 namespace MonoCasTests.System.Web.UI.WebControls {
45 public class LoginCas : AspNetHostingMinimal {
48 [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
49 public void Deny_Unrestricted ()
51 LoginTest unit = new LoginTest ();
52 unit.ReadOnlyFields ();
53 unit.DefaultProperties ();
54 unit.AssignToDefaultProperties ();
55 unit.NullProperties ();
56 unit.BorderPadding ();
57 unit.FailureAction_All ();
58 unit.LoginButtonType_All ();
59 unit.Orientation_All ();
60 unit.TextLayout_All ();
61 unit.SaveViewState ();
62 unit.OnBubbleEvent_Cancel_OnLoggingIn ();
63 unit.OnLoggingIn_False ();
64 unit.OnLoggingIn_True ();
70 [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
71 public void OnAuthenticate_True_Deny_Unrestricted ()
73 LoginTest unit = new LoginTest ();
75 unit.OnAuthenticate_True ();
77 catch (TypeInitializationException) {
78 // ms 2.0 - depending on the test run-order the HttpRuntime may throw
83 [SecurityPermission (SecurityAction.PermitOnly, ControlPrincipal = true)]
84 public void PermitOnly_ControlPrincipal ()
86 LoginTest unit = new LoginTest ();
88 unit.OnBubbleEvent ();
89 unit.OnAuthenticate_False ();
91 catch (TypeInitializationException) {
92 // ms 2.0 - depending on the test run-order the HttpRuntime may throw
97 [SecurityPermission (SecurityAction.Deny, ControlPrincipal = true)]
98 public void OnBubbleEvent_Deny_ControlPrincipal ()
100 LoginTest unit = new LoginTest ();
101 unit.OnBubbleEvent ();
105 [SecurityPermission (SecurityAction.Deny, ControlPrincipal = true)]
106 public void OnAuthenticate_False_Deny_ControlPrincipal ()
108 LoginTest unit = new LoginTest ();
109 unit.OnAuthenticate_False ();
114 public override Type Type {
115 get { return typeof (Login); }