Mercurial > altnet-hispano
annotate Agendas/trunk/src/Agendas.Tests/Cruds/EventoCrudNhTests.cs @ 169:5c94b052d838
Ticket 153: UI de Publicar. Faltaba la Duración del evento en la capa de negocios.
author | juanjose.montesdeocaarbos |
---|---|
date | Sat, 06 Aug 2011 12:41:46 -0300 |
parents | 3639803112c6 |
children | 5346c0500594 |
rev | line source |
---|---|
137 | 1 using Agendas.NHibernate; |
63 | 2 using AltNetHispano.Agendas.Domain; |
3 using AltNetHispano.Agendas.Repositories.NHibernate; | |
4 using Moq; | |
5 using NHibernate; | |
6 using NHibernate.Cfg; | |
7 using NHibernate.Tool.hbm2ddl; | |
8 using NUnit.Framework; | |
9 | |
10 namespace AltNetHispano.Agendas.Tests.Cruds | |
11 { | |
12 [TestFixture] | |
13 public class EventoCrudNhTests | |
14 { | |
15 private EventoCrud _eventoCrud; | |
16 | |
17 #region SetUp | |
18 | |
19 [SetUp] | |
20 public void BorrarRepositorios() | |
21 { | |
22 Configuration cfg =NhHelper.GetConfiguration(); | |
23 var schemaExport = new SchemaExport(cfg); | |
24 schemaExport.Create(false, true); | |
25 } | |
26 | |
27 [SetUp] | |
28 public void SetearUsuario() | |
29 { | |
30 var seguridad = new Mock<ISeguridad>(); | |
31 seguridad.Setup(s => s.GetUserName()).Returns("neluz"); | |
94
db4b1e2cae49
Cambio del nombre de la clase Ponente a Persona
Nelo@Kenia.neluz.int
parents:
67
diff
changeset
|
32 IdentityContext.Init(seguridad.Object, new PersonaRepository(NhHelper.GetSessionFactory())); |
63 | 33 } |
34 | |
35 [SetUp] | |
36 public void CreateCrud() | |
37 { | |
38 ISessionFactory sessionFactory=NhHelper.GetSessionFactory(); | |
94
db4b1e2cae49
Cambio del nombre de la clase Ponente a Persona
Nelo@Kenia.neluz.int
parents:
67
diff
changeset
|
39 _eventoCrud = new EventoCrud(() => new EventoRepository(sessionFactory), () => new PersonaRepository(sessionFactory), |
63 | 40 () => new RequestEmulator(sessionFactory)); |
41 } | |
42 | |
43 #endregion | |
44 | |
45 [Test] | |
46 public void Create() | |
47 { | |
48 _eventoCrud.Create(); | |
49 } | |
50 | |
51 [Test] | |
52 public void Read() | |
53 { | |
54 _eventoCrud.Read(); | |
55 } | |
56 | |
57 [Test] | |
58 public void Update() | |
59 { | |
60 _eventoCrud.Update(); | |
61 } | |
62 | |
63 [Test] | |
64 public void Delete() | |
65 { | |
66 _eventoCrud.Delete(); | |
67 } | |
140
3639803112c6
Refactoring de la relación entre Evento y Estado
nelopauselli
parents:
137
diff
changeset
|
68 |
3639803112c6
Refactoring de la relación entre Evento y Estado
nelopauselli
parents:
137
diff
changeset
|
69 [Test] |
3639803112c6
Refactoring de la relación entre Evento y Estado
nelopauselli
parents:
137
diff
changeset
|
70 public void Workflow() |
3639803112c6
Refactoring de la relación entre Evento y Estado
nelopauselli
parents:
137
diff
changeset
|
71 { |
3639803112c6
Refactoring de la relación entre Evento y Estado
nelopauselli
parents:
137
diff
changeset
|
72 _eventoCrud.Workflow(); |
3639803112c6
Refactoring de la relación entre Evento y Estado
nelopauselli
parents:
137
diff
changeset
|
73 } |
63 | 74 |
75 } | |
76 } |