Mercurial > altnet-hispano
view Agendas/trunk/src/Agendas.Tests/Cruds/EventoTests.cs @ 63:963b71ea6028
Repositorios con NH
author | nelopauselli |
---|---|
date | Tue, 17 May 2011 14:02:25 -0300 |
parents | c40b97bbed01 |
children | db4b1e2cae49 |
line wrap: on
line source
using System; using AltNetHispano.Agendas.Domain; using AltNetHispano.Agendas.Repositories.Memory; using Moq; using NUnit.Framework; namespace AltNetHispano.Agendas.Tests.Cruds { [TestFixture] public class EventoCrudMemoryTests { private EventoCrud _eventoCrud; #region SetUp [SetUp] public void BorrarRepositorios() { EventoRepository.Clear(); PonenteRepository.Clear(); } [SetUp] public void SetearUsuario() { var seguridad = new Mock<ISeguridad>(); seguridad.Setup(s => s.GetUserName()).Returns("neluz"); IdentityContext.Current = seguridad.Object; } [SetUp] public void CreateCrud() { _eventoCrud = new EventoCrud(() => new EventoRepository(), ()=>new PonenteRepository(), () => new Mock<IDisposable>().Object); } #endregion [Test] public void Create() { _eventoCrud.Create(); } [Test] public void Read() { _eventoCrud.Read(); } [Test] public void Update() { _eventoCrud.Update(); } [Test] public void Delete() { _eventoCrud.Delete(); } } }