view 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 source

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);
		}
	}
}