comparison Agendas/trunk/src/Agendas.Tests/Cruds/EventoCrudNhTests.cs @ 137:2d1adbaf0373

CRUD de Patrocinador
author nelopauselli
date Thu, 28 Jul 2011 09:26:24 -0300
parents db4b1e2cae49
children 3639803112c6
comparison
equal deleted inserted replaced
136:462a78196d11 137:2d1adbaf0373
1 using System; 1 using Agendas.NHibernate;
2 using Agendas.NHibernate;
3 using AltNetHispano.Agendas.Domain; 2 using AltNetHispano.Agendas.Domain;
4 using AltNetHispano.Agendas.Repositories.NHibernate; 3 using AltNetHispano.Agendas.Repositories.NHibernate;
5 using Moq; 4 using Moq;
6 using NHibernate; 5 using NHibernate;
7 using NHibernate.Cfg; 6 using NHibernate.Cfg;
8 using NHibernate.Context;
9 using NHibernate.Tool.hbm2ddl; 7 using NHibernate.Tool.hbm2ddl;
10 using NUnit.Framework; 8 using NUnit.Framework;
11 9
12 namespace AltNetHispano.Agendas.Tests.Cruds 10 namespace AltNetHispano.Agendas.Tests.Cruds
13 { 11 {
67 { 65 {
68 _eventoCrud.Delete(); 66 _eventoCrud.Delete();
69 } 67 }
70 68
71 } 69 }
72
73 public class RequestEmulator : IDisposable
74 {
75 private readonly ISession _session;
76
77 public RequestEmulator(ISessionFactory sessionFactory)
78 {
79 _session = sessionFactory.OpenSession();
80 CurrentSessionContext.Bind(_session);
81 }
82
83 public void Dispose()
84 {
85 _session.Flush();
86 _session.Close();
87 }
88 }
89 } 70 }