Mercurial > altnet-hispano
annotate Agendas/trunk/src/Agendas.Tests/Cruds/EventoCrudMemoryTests.cs @ 150:19bab30521da
Pasando DateTime a un EditorTemplates
author | Nelo@Guinea.neluz.int |
---|---|
date | Tue, 02 Aug 2011 23:24:19 -0300 |
parents | 3639803112c6 |
children |
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 | |
140
3639803112c6
Refactoring de la relación entre Evento y Estado
nelopauselli
parents:
137
diff
changeset
|
63 [Test] |
3639803112c6
Refactoring de la relación entre Evento y Estado
nelopauselli
parents:
137
diff
changeset
|
64 public void Workflow() |
3639803112c6
Refactoring de la relación entre Evento y Estado
nelopauselli
parents:
137
diff
changeset
|
65 { |
3639803112c6
Refactoring de la relación entre Evento y Estado
nelopauselli
parents:
137
diff
changeset
|
66 _eventoCrud.Workflow(); |
3639803112c6
Refactoring de la relación entre Evento y Estado
nelopauselli
parents:
137
diff
changeset
|
67 } |
60 | 68 } |
69 } |