public void TestIsInRole()
 {
     SecurePrincipal u = new SecurePrincipal(new SecureIdentity("test", null), new string[] { "role1", "role2" });
     Assert.IsTrue(u.IsInRole("role1"));
     Assert.IsTrue(u.IsInRole("role2"));
     Assert.IsFalse(u.IsInRole("role3"));
 }
        public void TestIsInRole()
        {
            SecurePrincipal u = new SecurePrincipal(new SecureIdentity("test", null), new string[] { "role1", "role2" });

            Assert.IsTrue(u.IsInRole("role1"));
            Assert.IsTrue(u.IsInRole("role2"));
            Assert.IsFalse(u.IsInRole("role3"));
        }
 public void TestPromotePrincipal()
 {
     SecurePrincipal u = new SecurePrincipal();
     u.Promote(new string[] {"r1", "r2"});
     Assert.AreEqual(2, u.AllRoles.Count());
     Assert.IsTrue(u.IsInRole("r1"));
     Assert.IsTrue(u.IsInRole("r2"));
 }
        public void TestPromotePrincipal()
        {
            SecurePrincipal u = new SecurePrincipal();

            u.Promote(new string[] { "r1", "r2" });
            Assert.AreEqual(2, u.AllRoles.Count());
            Assert.IsTrue(u.IsInRole("r1"));
            Assert.IsTrue(u.IsInRole("r2"));
        }
 public void TestAnonymous()
 {
     SecurePrincipal u = new SecurePrincipal();
     Assert.IsNotNull(u.Identity);
     Assert.IsNotNull(u.AllRoles);
     Assert.AreEqual(0, u.AllRoles.Count());
     Assert.IsFalse(u.IsInRole("test"));
     Assert.IsFalse(u.Identity.IsAuthenticated);
     Assert.AreEqual(string.Empty, u.Identity.AuthenticationType);
     Assert.AreEqual(string.Empty, u.Identity.Name);
 }
        public void TestAnonymous()
        {
            SecurePrincipal u = new SecurePrincipal();

            Assert.IsNotNull(u.Identity);
            Assert.IsNotNull(u.AllRoles);
            Assert.AreEqual(0, u.AllRoles.Count());
            Assert.IsFalse(u.IsInRole("test"));
            Assert.IsFalse(u.Identity.IsAuthenticated);
            Assert.AreEqual(string.Empty, u.Identity.AuthenticationType);
            Assert.AreEqual(string.Empty, u.Identity.Name);
        }