diff Agendas/trunk/src/Agendas.Tests/TestBase.cs @ 94:db4b1e2cae49

Cambio del nombre de la clase Ponente a Persona Se agrega la clase Cuenta para identificar cada una de las cuentas con que se puede autenticar una persona Alta Automatica de cuentas de twitter creando la persona
author Nelo@Kenia.neluz.int
date Sat, 04 Jun 2011 12:11:17 -0300
parents 3059a5f8930f
children 0bca45e1e664
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Tests/TestBase.cs	Sat Jun 04 00:07:20 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Tests/TestBase.cs	Sat Jun 04 12:11:17 2011 -0300
@@ -1,5 +1,6 @@
 using AltNetHispano.Agendas.Domain;
 using AltNetHispano.Agendas.Domain.Repositories;
+using AltNetHispano.Agendas.Domain.Services;
 using AltNetHispano.Agendas.Repositories.Memory;
 using Moq;
 using NUnit.Framework;
@@ -13,9 +14,9 @@
 			get { return new EventoRepository(); }
 		}
 
-		protected static IPonenteRepository DefaultPonenteRepository
+		protected static IPersonaRepository DefaultPersonaRepository
 		{
-			get { return new PonenteRepository(); }
+			get { return new PersonaRepository(); }
 		}
 
 		[SetUp]
@@ -27,20 +28,23 @@
 		[SetUp]
 		public void LimpiarPonentes()
 		{
-			PonenteRepository.Clear();
+			PersonaRepository.Clear();
+			SetCurrentUser("nelopauselli", "Nelo Pauselli");
 		}
 
-		[SetUp]
-		public void SetearUsuario()
+		protected static void SetCurrentUser(string username, string nombre)
 		{
-			SetCurrentUser("neluz");
-		}
+			const IdentityProviderEnum identityProvider = IdentityProviderEnum.Twitter;
 
-		protected static void SetCurrentUser(string username)
-		{
 			var seguridad = new Mock<ISeguridad>();
 			seguridad.Setup(s => s.GetUserName()).Returns(username);
-			IdentityContext.Current = seguridad.Object;
+			
+			IPersonaRepository personaRepository = new PersonaRepository();
+			var service = new PersonaService(personaRepository);
+			service.Validate(identityProvider, username, nombre);
+
+			IdentityContext.Init(seguridad.Object, personaRepository);
+
 		}
 	}
 }
\ No newline at end of file