Mercurial > altnet-hispano
view Agendas/trunk/src/Agendas.Tests/TestBase.cs @ 81:c76661cff260
Workflow de acciones sobre un evento (camino feliz)
author | nelopauselli |
---|---|
date | Tue, 24 May 2011 19:21:20 -0300 |
parents | 3059a5f8930f |
children | db4b1e2cae49 |
line wrap: on
line source
using AltNetHispano.Agendas.Domain; using AltNetHispano.Agendas.Domain.Repositories; using AltNetHispano.Agendas.Repositories.Memory; using Moq; using NUnit.Framework; namespace AltNetHispano.Agendas.Tests { public class TestBase { protected static IEventoRepository DefaultEventoRepository { get { return new EventoRepository(); } } protected static IPonenteRepository DefaultPonenteRepository { get { return new PonenteRepository(); } } [SetUp] public void LimpiarEventos() { EventoRepository.Clear(); } [SetUp] public void LimpiarPonentes() { PonenteRepository.Clear(); } [SetUp] public void SetearUsuario() { SetCurrentUser("neluz"); } protected static void SetCurrentUser(string username) { var seguridad = new Mock<ISeguridad>(); seguridad.Setup(s => s.GetUserName()).Returns(username); IdentityContext.Current = seguridad.Object; } } }