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
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents: 94
diff changeset
1 using Agendas.NHibernate;
63
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
2 using AltNetHispano.Agendas.Domain;
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
3 using AltNetHispano.Agendas.Repositories.NHibernate;
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
4 using Moq;
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
5 using NHibernate;
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
6 using NHibernate.Cfg;
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
7 using NHibernate.Tool.hbm2ddl;
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
8 using NUnit.Framework;
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
9
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
10 namespace AltNetHispano.Agendas.Tests.Cruds
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
11 {
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
12 [TestFixture]
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
13 public class EventoCrudNhTests
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
14 {
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
15 private EventoCrud _eventoCrud;
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
16
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
17 #region SetUp
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
18
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
19 [SetUp]
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
20 public void BorrarRepositorios()
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
21 {
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
22 Configuration cfg =NhHelper.GetConfiguration();
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
23 var schemaExport = new SchemaExport(cfg);
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
24 schemaExport.Create(false, true);
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
25 }
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
26
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
27 [SetUp]
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
28 public void SetearUsuario()
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
29 {
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
30 var seguridad = new Mock<ISeguridad>();
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
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
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
33 }
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
34
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
35 [SetUp]
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
36 public void CreateCrud()
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
37 {
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
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
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
40 () => new RequestEmulator(sessionFactory));
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
41 }
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
42
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
43 #endregion
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
44
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
45 [Test]
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
46 public void Create()
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
47 {
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
48 _eventoCrud.Create();
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
49 }
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
50
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
51 [Test]
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
52 public void Read()
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
53 {
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
54 _eventoCrud.Read();
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
55 }
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
56
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
57 [Test]
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
58 public void Update()
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
59 {
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
60 _eventoCrud.Update();
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
61 }
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
62
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
63 [Test]
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
64 public void Delete()
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
65 {
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
66 _eventoCrud.Delete();
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
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
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
74
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
75 }
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
76 }