annotate Agendas/trunk/src/Agendas.Tests/Cruds/EventoTests.cs @ 94:db4b1e2cae49

Cambio del nombre de la clase Ponente a Persona Se agrega la clase Cuenta para identificar cada una de las cuentas con que se puede autenticar una persona Alta Automatica de cuentas de twitter creando la persona
author Nelo@Kenia.neluz.int
date Sat, 04 Jun 2011 12:11:17 -0300
parents 963b71ea6028
children
rev   line source
60
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
1 using System;
63
963b71ea6028 Repositorios con NH
nelopauselli
parents: 62
diff changeset
2 using AltNetHispano.Agendas.Domain;
60
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
3 using AltNetHispano.Agendas.Repositories.Memory;
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
4 using Moq;
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
5 using NUnit.Framework;
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
6
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
7 namespace AltNetHispano.Agendas.Tests.Cruds
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
8 {
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
9 [TestFixture]
63
963b71ea6028 Repositorios con NH
nelopauselli
parents: 62
diff changeset
10 public class EventoCrudMemoryTests
60
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
11 {
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
12 private EventoCrud _eventoCrud;
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
13
63
963b71ea6028 Repositorios con NH
nelopauselli
parents: 62
diff changeset
14 #region SetUp
963b71ea6028 Repositorios con NH
nelopauselli
parents: 62
diff changeset
15
963b71ea6028 Repositorios con NH
nelopauselli
parents: 62
diff changeset
16 [SetUp]
963b71ea6028 Repositorios con NH
nelopauselli
parents: 62
diff changeset
17 public void BorrarRepositorios()
963b71ea6028 Repositorios con NH
nelopauselli
parents: 62
diff changeset
18 {
963b71ea6028 Repositorios con NH
nelopauselli
parents: 62
diff changeset
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
963b71ea6028 Repositorios con NH
nelopauselli
parents: 62
diff changeset
21 }
963b71ea6028 Repositorios con NH
nelopauselli
parents: 62
diff changeset
22
963b71ea6028 Repositorios con NH
nelopauselli
parents: 62
diff changeset
23 [SetUp]
963b71ea6028 Repositorios con NH
nelopauselli
parents: 62
diff changeset
24 public void SetearUsuario()
963b71ea6028 Repositorios con NH
nelopauselli
parents: 62
diff changeset
25 {
963b71ea6028 Repositorios con NH
nelopauselli
parents: 62
diff changeset
26 var seguridad = new Mock<ISeguridad>();
963b71ea6028 Repositorios con NH
nelopauselli
parents: 62
diff changeset
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
963b71ea6028 Repositorios con NH
nelopauselli
parents: 62
diff changeset
29 }
963b71ea6028 Repositorios con NH
nelopauselli
parents: 62
diff changeset
30
60
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
31 [SetUp]
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
32 public void CreateCrud()
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
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
963b71ea6028 Repositorios con NH
nelopauselli
parents: 62
diff changeset
35 }
60
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
36
63
963b71ea6028 Repositorios con NH
nelopauselli
parents: 62
diff changeset
37 #endregion
60
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
38
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
39 [Test]
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
40 public void Create()
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
41 {
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
42 _eventoCrud.Create();
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
43 }
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
44
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
45 [Test]
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
46 public void Read()
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
47 {
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
48 _eventoCrud.Read();
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
49 }
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
50
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
51 [Test]
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
52 public void Update()
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
53 {
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
54 _eventoCrud.Update();
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
55 }
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
56
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
57 [Test]
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
58 public void Delete()
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
59 {
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
60 _eventoCrud.Delete();
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
61 }
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
62
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
63 }
02e163f2ca38 Refactoring de test de crud del evento
nelopauselli
parents:
diff changeset
64 }