diff Agendas/trunk/src/Agendas.Tests/Cruds/EventoCrudMemoryTests.cs @ 137:2d1adbaf0373

CRUD de Patrocinador
author nelopauselli
date Thu, 28 Jul 2011 09:26:24 -0300
parents Agendas/trunk/src/Agendas.Tests/Cruds/EventoTests.cs@db4b1e2cae49
children 3639803112c6
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Agendas/trunk/src/Agendas.Tests/Cruds/EventoCrudMemoryTests.cs	Thu Jul 28 09:26:24 2011 -0300
@@ -0,0 +1,64 @@
+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();
+			PersonaRepository.Clear();
+		}
+
+		[SetUp]
+		public void SetearUsuario()
+		{
+			var seguridad = new Mock<ISeguridad>();
+			seguridad.Setup(s => s.GetUserName()).Returns("neluz");
+			IdentityContext.Init(seguridad.Object, new PersonaRepository());
+		}
+
+		[SetUp]
+		public void CreateCrud()
+		{
+			_eventoCrud = new EventoCrud(() => new EventoRepository(), ()=>new PersonaRepository(), () => 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();
+		}
+
+	}
+}
\ No newline at end of file