Exemplo n.º 1
0
        public void DeleteRoleTest2()
        {
            try {
                RainbowRoleProvider provider = Roles.Provider as RainbowRoleProvider;

                provider.CreateRole("tempRole1");
                provider.DeleteRole("tempRole1", true);
            }
            catch (Exception ex) {
                Console.WriteLine(ex.Message);
                Assert.Fail("Error in DeleteRoleTest2" + ex.Message, ex);
            }
        }
Exemplo n.º 2
0
        public void DeleteRoleTest5()
        {
            try {
                RainbowRoleProvider provider = Roles.Provider as RainbowRoleProvider;

                provider.DeleteRole("invalidRole", true);
                Assert.Fail();
            }
            catch (RainbowRoleProviderException) {}
            catch (Exception ex) {
                Console.WriteLine(ex.Message);
                Assert.Fail("Error in DeleteRoleTest5" + ex.Message, ex);
            }
        }
Exemplo n.º 3
0
        public void DeleteRoleTest1()
        {
            try {
                RainbowRoleProvider provider = Roles.Provider as RainbowRoleProvider;

                provider.DeleteRole("Admins", true);
                Assert.Fail(); // Admins has users
            }
            catch (RainbowRoleProviderException) {}
            catch (Exception ex) {
                Console.WriteLine(ex.Message);
                Assert.Fail("Error in DeleteRoleTest1" + ex.Message, ex);
            }
        }
Exemplo n.º 4
0
        public void DeleteRoleTest4()
        {
            try {
                RainbowRoleProvider provider = Roles.Provider as RainbowRoleProvider;

                RainbowRole editors = provider.GetRoleByName("Rainbow", "editors");
                provider.DeleteRole("invalidApp", editors.Id, true);
                Assert.Fail();
            }
            catch (RainbowRoleProviderException) {}
            catch (Exception ex) {
                Console.WriteLine(ex.Message);
                Assert.Fail("Error in DeleteRoleTest4" + ex.Message, ex);
            }
        }
Exemplo n.º 5
0
        public void DeleteRoleTest3()
        {
            try {
                RainbowRoleProvider provider = Roles.Provider as RainbowRoleProvider;

                provider.CreateRole("tempRole2");

                provider.AddUsersToRoles(new string[] { "*****@*****.**" }, new string[] { "tempRole2" });

                provider.DeleteRole("tempRole2", false);
            }
            catch (Exception ex) {
                Console.WriteLine(ex.Message);
                Assert.Fail("Error in DeleteRoleTest3" + ex.Message, ex);
            }
        }