Mercurial > altnet-hispano
annotate Agendas/trunk/src/Agendas.Repositories.Tests/PatrocinadorCrudMemoryTests.cs @ 285:c8f378272407
#123: Patrocinadores de las vans.
author | juanjose.montesdeocaarbos |
---|---|
date | Sat, 31 Dec 2011 14:45:55 -0300 |
parents | 72a96459f910 |
children |
rev | line source |
---|---|
274
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
1 using System; |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
2 using AltNetHispano.Agendas.Domain; |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
3 using AltNetHispano.Agendas.Repositories.Memory; |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
4 using Moq; |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
5 using NUnit.Framework; |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
6 |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
7 namespace Agendas.Repositories.Tests |
137 | 8 { |
274
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
9 [TestFixture] |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
10 public class PatrocinadorCrudMemoryTests |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
11 { |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
12 private PatrocinadorCrud _eventoCrud; |
137 | 13 |
274
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
14 #region SetUp |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
15 |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
16 [SetUp] |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
17 public void BorrarRepositorios() |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
18 { |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
19 PatrocinadorRepository.Clear(); |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
20 } |
137 | 21 |
274
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
22 [SetUp] |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
23 public void SetearUsuario() |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
24 { |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
25 var seguridad = new Mock<ISeguridad>(); |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
26 seguridad.Setup(s => s.GetUserName()).Returns("neluz"); |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
27 IdentityContext.Init(seguridad.Object, new PersonaRepository()); |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
28 } |
137 | 29 |
274
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
30 [SetUp] |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
31 public void CreateCrud() |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
32 { |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
33 _eventoCrud = new PatrocinadorCrud(() => new PatrocinadorRepository(), () => new Mock<IDisposable>().Object); |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
34 } |
137 | 35 |
274
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
36 #endregion |
137 | 37 |
274
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
38 [Test] |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
39 public void Create() |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
40 { |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
41 _eventoCrud.Create(); |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
42 } |
137 | 43 |
274
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
44 [Test] |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
45 public void Read() |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
46 { |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
47 _eventoCrud.Read(); |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
48 } |
137 | 49 |
274
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
50 [Test] |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
51 public void Update() |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
52 { |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
53 _eventoCrud.Update(); |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
54 } |
137 | 55 |
274
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
56 [Test] |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
57 public void Delete() |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
58 { |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
59 _eventoCrud.Delete(); |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
60 } |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
61 |
72a96459f910
Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents:
222
diff
changeset
|
62 } |
137 | 63 } |