public void CreateAndDeleteRoles()
        {
            roleProvider = new RoleProvider();
            NameValueCollection config = new NameValueCollection();

            config.Add("connectionStringName", _connStrName);
            config.Add("applicationName", _applicationName);
            roleProvider.Initialize(null, config);

            // Add the role
            roleProvider.CreateRole("Administrator");
            string[] roles = roleProvider.GetAllRoles();
            Assert.AreEqual(1, roles.Length);
            Assert.AreEqual("administrator", roles[0]);

            // now delete the role
            roleProvider.DeleteRole("Administrator", false);
            roles = roleProvider.GetAllRoles();
            Assert.AreEqual(0, roles.Length);
        }
        public void GetAllRolesTest()
        {
            roleProvider = new RoleProvider();
            NameValueCollection config = new NameValueCollection();

            config.Add("connectionStringName", _connStrName);
            config.Add("applicationName", _applicationName);
            roleProvider.Initialize(null, config);

            roleProvider.CreateRole("Administrator");
            roleProvider.CreateRole("User");
            roleProvider.CreateRole("Editor");


            var roles = roleProvider.GetAllRoles();

            Assert.AreEqual(3, roles.Length);
            Assert.IsTrue(roles.Contains("administrator"));
            Assert.IsTrue(roles.Contains("user"));
            Assert.IsTrue(roles.Contains("editor"));
        }
        public void GetAllRolesTest()
        {
            roleProvider = new RoleProvider();
            NameValueCollection config = new NameValueCollection();
            config.Add("connectionStringName", _connStrName);
            config.Add("applicationName", _applicationName);
            roleProvider.Initialize(null, config);

            roleProvider.CreateRole("Administrator");
            roleProvider.CreateRole("User");
            roleProvider.CreateRole("Editor");

            var roles = roleProvider.GetAllRoles();
            Assert.AreEqual(3, roles.Length);
            Assert.IsTrue(roles.Contains("administrator"));
            Assert.IsTrue(roles.Contains("user"));
            Assert.IsTrue(roles.Contains("editor"));
        }
        public void CreateAndDeleteRoles()
        {
            roleProvider = new RoleProvider();
            NameValueCollection config = new NameValueCollection();
            config.Add("connectionStringName", _connStrName);
            config.Add("applicationName", _applicationName);
            roleProvider.Initialize(null, config);

            // Add the role
            roleProvider.CreateRole("Administrator");
            string[] roles = roleProvider.GetAllRoles();
            Assert.AreEqual(1, roles.Length);
            Assert.AreEqual("administrator", roles[0]);

            // now delete the role
            roleProvider.DeleteRole("Administrator", false);
            roles = roleProvider.GetAllRoles();
            Assert.AreEqual(0, roles.Length);
        }