Mercurial > altnet-hispano
diff Agendas/trunk/src/Agendas.Tests/IdentityContextTests.cs @ 179:1deccd6c3cb2
Aplicando seguridad x roles en sitio web
author | nelopauselli |
---|---|
date | Mon, 08 Aug 2011 15:24:26 -0300 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Tests/IdentityContextTests.cs Mon Aug 08 15:24:26 2011 -0300 @@ -0,0 +1,19 @@ +using AltNetHispano.Agendas.Domain; +using NUnit.Framework; + +namespace AltNetHispano.Agendas.Tests +{ + [TestFixture] + public class IdentityContextTests : TestBase + { + [Test] + public void IsInRole() + { + var persona = new Persona("Nelo"); + persona.Roles.Add(Roles.Usuario); + + Assert.IsTrue(IdentityContext.IsInRole(persona, new[] { Roles.Usuario })); + Assert.IsFalse(IdentityContext.IsInRole(persona, new[] { Roles.Administrador })); + } + } +} \ No newline at end of file