Mercurial > altnet-hispano
annotate Agendas/trunk/src/Agendas.Tests/Cruds/EventoCrudMemoryTests.cs @ 137:2d1adbaf0373
CRUD de Patrocinador
author | nelopauselli |
---|---|
date | Thu, 28 Jul 2011 09:26:24 -0300 |
parents | Agendas/trunk/src/Agendas.Tests/Cruds/EventoTests.cs@db4b1e2cae49 |
children | 3639803112c6 |
rev | line source |
---|---|
60 | 1 using System; |
63 | 2 using AltNetHispano.Agendas.Domain; |
60 | 3 using AltNetHispano.Agendas.Repositories.Memory; |
4 using Moq; | |
5 using NUnit.Framework; | |
6 | |
7 namespace AltNetHispano.Agendas.Tests.Cruds | |
8 { | |
9 [TestFixture] | |
63 | 10 public class EventoCrudMemoryTests |
60 | 11 { |
12 private EventoCrud _eventoCrud; | |
13 | |
63 | 14 #region SetUp |
15 | |
16 [SetUp] | |
17 public void BorrarRepositorios() | |
18 { | |
19 EventoRepository.Clear(); | |
94
db4b1e2cae49
Cambio del nombre de la clase Ponente a Persona
Nelo@Kenia.neluz.int
parents:
63
diff
changeset
|
20 PersonaRepository.Clear(); |
63 | 21 } |
22 | |
23 [SetUp] | |
24 public void SetearUsuario() | |
25 { | |
26 var seguridad = new Mock<ISeguridad>(); | |
27 seguridad.Setup(s => s.GetUserName()).Returns("neluz"); | |
94
db4b1e2cae49
Cambio del nombre de la clase Ponente a Persona
Nelo@Kenia.neluz.int
parents:
63
diff
changeset
|
28 IdentityContext.Init(seguridad.Object, new PersonaRepository()); |
63 | 29 } |
30 | |
60 | 31 [SetUp] |
32 public void CreateCrud() | |
33 { | |
94
db4b1e2cae49
Cambio del nombre de la clase Ponente a Persona
Nelo@Kenia.neluz.int
parents:
63
diff
changeset
|
34 _eventoCrud = new EventoCrud(() => new EventoRepository(), ()=>new PersonaRepository(), () => new Mock<IDisposable>().Object); |
63 | 35 } |
60 | 36 |
63 | 37 #endregion |
60 | 38 |
39 [Test] | |
40 public void Create() | |
41 { | |
42 _eventoCrud.Create(); | |
43 } | |
44 | |
45 [Test] | |
46 public void Read() | |
47 { | |
48 _eventoCrud.Read(); | |
49 } | |
50 | |
51 [Test] | |
52 public void Update() | |
53 { | |
54 _eventoCrud.Update(); | |
55 } | |
56 | |
57 [Test] | |
58 public void Delete() | |
59 { | |
60 _eventoCrud.Delete(); | |
61 } | |
62 | |
63 } | |
64 } |