Mercurial > altnet-hispano
diff Agendas/trunk/src/Agendas.Repositories.Tests/Infraestructure/NhInfraestrutureFactory.cs @ 222:68b09c30b0d2
Separando los test de persistencia en un proyecto aparte
author | nelopauselli |
---|---|
date | Mon, 19 Sep 2011 18:18:17 -0300 |
parents | |
children | 72a96459f910 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Repositories.Tests/Infraestructure/NhInfraestrutureFactory.cs Mon Sep 19 18:18:17 2011 -0300 @@ -0,0 +1,32 @@ +using System; +using Agendas.NHibernate; +using AltNetHispano.Agendas.Domain.Repositories; +using AltNetHispano.Agendas.Repositories.NHibernate; +using NHibernate; + +namespace Agendas.Repositories.Tests.Infraestructure +{ + public class NhInfraestrutureFactory:IInfraestrutureFactory + { + private readonly ISessionFactory _sessionFactory; + + public NhInfraestrutureFactory() + { + _sessionFactory = NhHelper.GetSessionFactory(); + } + public IEventoRepository GetEventoRepository() + { + return new EventoRepository(_sessionFactory); + } + + public IPersonaRepository GetPonenteRepository() + { + return new PersonaRepository(_sessionFactory); + } + + public Func<IDisposable> GetRequestEmulator() + { + return () => new RequestEmulator(_sessionFactory); + } + } +} \ No newline at end of file