annotate Agendas/trunk/src/Agendas.Tests/Cruds/RequestEmulator.cs @ 202:a731086c0b28

Se soluciona ticket 174. Además se agrega detalle del campo Hora y Duración cuando son obligatorios en Resources.
author alabra
date Sat, 20 Aug 2011 18:40:36 -0400
parents 2d1adbaf0373
children
rev   line source
137
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
1 using System;
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
2 using NHibernate;
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
3 using NHibernate.Context;
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
4
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
5 namespace AltNetHispano.Agendas.Tests.Cruds
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
6 {
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
7 public class RequestEmulator : IDisposable
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
8 {
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
9 private readonly ISession _session;
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
10
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
11 public RequestEmulator(ISessionFactory sessionFactory)
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
12 {
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
13 _session = sessionFactory.OpenSession();
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
14 CurrentSessionContext.Bind(_session);
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
15 }
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
16
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
17 public void Dispose()
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
18 {
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
19 _session.Flush();
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
20 _session.Close();
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
21 }
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
22 }
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
23 }