annotate Agendas/trunk/src/Agendas.Tests/TrackTests.cs @ 95:83d76f6e0a3c

Quitando la lista de eventos de la persona ya que no se usaba mas que en los tests
author Nelo@Kenia.neluz.int
date Sat, 04 Jun 2011 18:33:15 -0300
parents db4b1e2cae49
children 80c22175c9b5
rev   line source
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
1 using System;
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
2 using System.Linq;
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
3 using AltNetHispano.Agendas.Domain;
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
4 using NUnit.Framework;
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
5
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
6 namespace AltNetHispano.Agendas.Tests
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
7 {
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
8 [TestFixture]
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
9 public class TrackTests : TestBase
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
10 {
70
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 54
diff changeset
11 private const string urlInvitacion = "http://groups.google.com/group/altnet-hispano/browse_thread/thread/65d6d26eb381386e";
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 54
diff changeset
12
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
13 [Test]
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
14 public void Track_al_publicar_y_modificar_evento()
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
15 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
16 var repository = DefaultEventoRepository;
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
17
94
db4b1e2cae49 Cambio del nombre de la clase Ponente a Persona
Nelo@Kenia.neluz.int
parents: 87
diff changeset
18 var agenda = new Agenda(null, repository, DefaultPersonaRepository);
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
19
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
20 var fecha = DateTime.Now.AddDays(5);
74
bc46e7426c80 Refactoring de acciones según la definición del diagrama de estados en assembla
nelopauselli
parents: 73
diff changeset
21 agenda.Agendar("Html 5", "jjmontes", fecha, urlInvitacion);
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
22 var evento = repository.GetEventosConFecha().First();
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
23
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
24 Assert.AreEqual(1, evento.Tracks.Count());
80
c2d98fd6593f Track como objeto identificable y con referencia al evento correspondiente.
nelopauselli
parents: 75
diff changeset
25 var ultimo = evento.Tracks.Last();
c2d98fd6593f Track como objeto identificable y con referencia al evento correspondiente.
nelopauselli
parents: 75
diff changeset
26 Assert.AreEqual(evento, ultimo.Evento);
c2d98fd6593f Track como objeto identificable y con referencia al evento correspondiente.
nelopauselli
parents: 75
diff changeset
27 Assert.AreEqual(Accion.Agendar, ultimo.Accion);
94
db4b1e2cae49 Cambio del nombre de la clase Ponente a Persona
Nelo@Kenia.neluz.int
parents: 87
diff changeset
28 Assert.IsNotNull(ultimo.Usuario);
db4b1e2cae49 Cambio del nombre de la clase Ponente a Persona
Nelo@Kenia.neluz.int
parents: 87
diff changeset
29 Assert.AreEqual("Nelo Pauselli", ultimo.Usuario.Nombre);
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
30
75
96d7609f2e08 Agendar evento propuesto
nelopauselli
parents: 74
diff changeset
31 agenda.ModificarEvento(evento.Id, "Html 5", "otro ponente", fecha, urlInvitacion);
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
32 Assert.AreEqual(2, evento.Tracks.Count());
80
c2d98fd6593f Track como objeto identificable y con referencia al evento correspondiente.
nelopauselli
parents: 75
diff changeset
33 ultimo = evento.Tracks.Last();
c2d98fd6593f Track como objeto identificable y con referencia al evento correspondiente.
nelopauselli
parents: 75
diff changeset
34 Assert.AreEqual(evento, ultimo.Evento);
c2d98fd6593f Track como objeto identificable y con referencia al evento correspondiente.
nelopauselli
parents: 75
diff changeset
35 Assert.AreEqual(Accion.Modificar, ultimo.Accion);
94
db4b1e2cae49 Cambio del nombre de la clase Ponente a Persona
Nelo@Kenia.neluz.int
parents: 87
diff changeset
36 Assert.IsNotNull(ultimo.Usuario);
db4b1e2cae49 Cambio del nombre de la clase Ponente a Persona
Nelo@Kenia.neluz.int
parents: 87
diff changeset
37 Assert.AreEqual("Nelo Pauselli", ultimo.Usuario.Nombre);
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
38
75
96d7609f2e08 Agendar evento propuesto
nelopauselli
parents: 74
diff changeset
39 agenda.ModificarEvento(evento.Id, "Html 5 y Css 3", "otro ponente", fecha, urlInvitacion);
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
40 Assert.AreEqual(3, evento.Tracks.Count());
80
c2d98fd6593f Track como objeto identificable y con referencia al evento correspondiente.
nelopauselli
parents: 75
diff changeset
41 ultimo = evento.Tracks.Last();
c2d98fd6593f Track como objeto identificable y con referencia al evento correspondiente.
nelopauselli
parents: 75
diff changeset
42 Assert.AreEqual(evento, ultimo.Evento);
c2d98fd6593f Track como objeto identificable y con referencia al evento correspondiente.
nelopauselli
parents: 75
diff changeset
43 Assert.AreEqual(Accion.CambiarTitulo, ultimo.Accion);
94
db4b1e2cae49 Cambio del nombre de la clase Ponente a Persona
Nelo@Kenia.neluz.int
parents: 87
diff changeset
44 Assert.IsNotNull(ultimo.Usuario);
db4b1e2cae49 Cambio del nombre de la clase Ponente a Persona
Nelo@Kenia.neluz.int
parents: 87
diff changeset
45 Assert.AreEqual("Nelo Pauselli", ultimo.Usuario.Nombre);
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
46 }
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
47
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
48 [Test]
73
76567a0d1e44 Eliminando algunas propiedades que no se estaban usando
nelopauselli
parents: 70
diff changeset
49 public void Track_al_publicar_y_confirmar_evento()
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
50 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
51 var repository = DefaultEventoRepository;
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
52
94
db4b1e2cae49 Cambio del nombre de la clase Ponente a Persona
Nelo@Kenia.neluz.int
parents: 87
diff changeset
53 var agenda = new Agenda(null, repository, DefaultPersonaRepository);
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
54
74
bc46e7426c80 Refactoring de acciones según la definición del diagrama de estados en assembla
nelopauselli
parents: 73
diff changeset
55 agenda.Agendar("Html 5", "jjmontes", DateTime.Now,
70
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 54
diff changeset
56 urlInvitacion);
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
57 var evento = repository.GetEventosConFecha().First();
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
58
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
59 Assert.AreEqual(1, evento.Tracks.Count());
74
bc46e7426c80 Refactoring de acciones según la definición del diagrama de estados en assembla
nelopauselli
parents: 73
diff changeset
60 Assert.AreEqual(Accion.Agendar, evento.Tracks.Last().Accion);
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
61
73
76567a0d1e44 Eliminando algunas propiedades que no se estaban usando
nelopauselli
parents: 70
diff changeset
62 //TODO: confirmar evento y evaluar .tracks
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
63 }
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
64 }
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
65 }