view Agendas/trunk/src/Agendas.Tests/Cruds/EventoTests.cs @ 75:96d7609f2e08

Agendar evento propuesto
author nelopauselli
date Mon, 23 May 2011 20:43:01 -0300
parents 963b71ea6028
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();
		}

	}
}