[bcl] Remove more NET_2_0 checks from class libs
[mono.git] / mcs / class / System.Web / Test / mainsoft / NunitWeb / NunitWeb / TestRoleProvider.cs
1
2 using System;
3 using System.Collections.Specialized;
4 using System.Configuration.Provider;
5 using System.Web.Security;
6
7 namespace MonoTests.SystemWeb.Framework
8 {
9         public class TestRoleProvider : RoleProvider
10         {
11                 public override string ApplicationName
12                 {
13                         get;
14                         set;
15                 }
16
17                 public override void AddUsersToRoles(string[] usernames, string[] roleNames)
18                 {
19                         throw new Exception ("Not implemented yet.");
20                 }
21
22                 public override void CreateRole (string roleName)
23                 {
24                         throw new Exception ("Not implemented yet.");
25                 }
26
27                 public override bool DeleteRole (string roleName, bool throwOnPopulatedRole)
28                 {
29                         throw new Exception ("Not implemented yet.");
30                 }
31
32                 public override string[] FindUsersInRole (string roleName, string usernameToMatch)
33                 {
34                         throw new Exception ("Not implemented yet.");
35                 }
36
37                 public override string[] GetAllRoles ()
38                 {
39                         throw new Exception ("Not implemented yet.");
40                 }
41
42                 public override string[] GetRolesForUser (string username)
43                 {
44                         throw new Exception ("Not implemented yet.");
45                 }
46
47                 public override string[] GetUsersInRole (string roleName)
48                 {
49                         throw new Exception ("Not implemented yet.");
50                 }
51
52                 public override bool IsUserInRole (string username, string roleName)
53                 {
54                         if (username == null)
55                                 throw new ArgumentNullException ("Username cannot be null.");
56                         if (roleName == null)
57                                 throw new ArgumentNullException ("Role name cannot be null.");
58                         if (username == string.Empty)
59                                 throw new ArgumentException ("Username cannot be empty.");
60                         if (roleName == string.Empty)
61                                 throw new ArgumentException ("Role name cannot be empty.");
62                         if (username == "invalid")
63                                 throw new ProviderException ("User does not exist.");
64                         if (roleName == "invalid")
65                                 throw new ProviderException ("Role does not exist.");
66                         if (username == "true")
67                                 return true;
68                         return false;
69                 }
70
71                 public override void RemoveUsersFromRoles (string[] usernames, string[] roleNames)
72                 {
73                         throw new Exception ("Not implemented yet.");
74                 }
75
76                 public override bool RoleExists (string roleName)
77                 {
78                         throw new Exception ("Not implemented yet.");
79                 }
80         }
81 }