diff Agendas/trunk/src/Agendas.Tests/Cruds/PersonaCrudMemoryTests.cs @ 178:33e57fd1a6c9

Roles: en dominio y autoregistración
author nelopauselli
date Mon, 08 Aug 2011 12:30:37 -0300
parents
children a36a76bd6ec3
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Agendas/trunk/src/Agendas.Tests/Cruds/PersonaCrudMemoryTests.cs	Mon Aug 08 12:30:37 2011 -0300
@@ -0,0 +1,68 @@
+using System;
+using AltNetHispano.Agendas.Domain;
+using AltNetHispano.Agendas.Repositories.Memory;
+using Moq;
+using NUnit.Framework;
+
+namespace AltNetHispano.Agendas.Tests.Cruds
+{
+	[TestFixture]
+	public class PersonaCrudMemoryTests : IPersonaCrudTest
+	{
+		private PersonaCrud _test;
+
+		#region SetUp
+
+		[SetUp]
+		public void BorrarRepositorios()
+		{
+			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()
+		{
+			_test = new PersonaCrud(() => new PersonaRepository(), () => new Mock<IDisposable>().Object);
+		}
+
+		#endregion
+
+		[Test]
+		public void CreateAdministrador()
+		{
+			_test.CreateAdministrador();
+		}
+
+		[Test]
+		public void ReadAdministrador()
+		{
+			_test.ReadAdministrador();
+		}
+
+		[Test]
+		public void CreateUsuario()
+		{
+			_test.CreateUsuario();
+		}
+
+		[Test]
+		public void ReadUsuario()
+		{
+			_test.ReadUsuario();
+		}
+
+		[Test]
+		public void Update()
+		{
+			_test.Update();
+		}
+	}
+}
\ No newline at end of file