Mercurial > altnet-hispano
annotate Agendas/trunk/src/Agendas.Tests/Cruds/PersonaCrudNhTests.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 | 5346c0500594 |
children | a36a76bd6ec3 |
rev | line source |
---|---|
178 | 1 using Agendas.NHibernate; |
2 using AltNetHispano.Agendas.Domain; | |
3 using AltNetHispano.Agendas.Repositories.NHibernate; | |
4 using Moq; | |
5 using NHibernate; | |
6 using NUnit.Framework; | |
7 | |
8 namespace AltNetHispano.Agendas.Tests.Cruds | |
9 { | |
10 [TestFixture] | |
11 public class PersonaCrudNhTests : IPersonaCrudTest | |
12 { | |
13 private PersonaCrud _test; | |
14 | |
15 #region SetUp | |
16 | |
17 [SetUp] | |
18 public void BorrarRepositorios() | |
19 { | |
200
5346c0500594
Pasando a estructura de db fija, ya no se crea automáticamente.
nelopauselli
parents:
178
diff
changeset
|
20 NhHelperTest.CleanDb(); |
178 | 21 } |
22 | |
23 [SetUp] | |
24 public void SetearUsuario() | |
25 { | |
26 var seguridad = new Mock<ISeguridad>(); | |
27 seguridad.Setup(s => s.GetUserName()).Returns("neluz"); | |
28 IdentityContext.Init(seguridad.Object, new PersonaRepository(NhHelper.GetSessionFactory())); | |
29 } | |
30 | |
31 [SetUp] | |
32 public void CreateCrud() | |
33 { | |
34 ISessionFactory sessionFactory = NhHelper.GetSessionFactory(); | |
35 _test = new PersonaCrud(() => new PersonaRepository(sessionFactory), () => new RequestEmulator(sessionFactory)); | |
36 } | |
37 | |
38 #endregion | |
39 | |
40 [Test] | |
41 public void CreateAdministrador() | |
42 { | |
43 _test.CreateAdministrador(); | |
44 } | |
45 | |
46 [Test] | |
47 public void ReadAdministrador() | |
48 { | |
49 _test.ReadAdministrador(); | |
50 } | |
51 | |
52 [Test] | |
53 public void CreateUsuario() | |
54 { | |
55 _test.CreateUsuario(); | |
56 } | |
57 | |
58 [Test] | |
59 public void ReadUsuario() | |
60 { | |
61 _test.ReadUsuario(); | |
62 } | |
63 | |
64 [Test] | |
65 public void Update() | |
66 { | |
67 _test.Update(); | |
68 } | |
69 } | |
70 } |