Mercurial > altnet-hispano
annotate Agendas/trunk/src/Agendas.Repositories.Tests/Infraestructure/RequestEmulator.cs @ 275:bf993f99cee3
Ticket #123: Patrocinadores de las vans.
author | juanjose.montesdeocaarbos |
---|---|
date | Wed, 14 Dec 2011 08:15:44 -0300 |
parents | 68b09c30b0d2 |
children |
rev | line source |
---|---|
137 | 1 using System; |
2 using NHibernate; | |
3 using NHibernate.Context; | |
4 | |
222
68b09c30b0d2
Separando los test de persistencia en un proyecto aparte
nelopauselli
parents:
137
diff
changeset
|
5 namespace Agendas.Repositories.Tests.Infraestructure |
137 | 6 { |
7 public class RequestEmulator : IDisposable | |
8 { | |
9 private readonly ISession _session; | |
10 | |
11 public RequestEmulator(ISessionFactory sessionFactory) | |
12 { | |
13 _session = sessionFactory.OpenSession(); | |
14 CurrentSessionContext.Bind(_session); | |
15 } | |
16 | |
17 public void Dispose() | |
18 { | |
19 _session.Flush(); | |
20 _session.Close(); | |
21 } | |
22 } | |
23 } |