annotate Agendas/trunk/src/Agendas.Tests/TrackTests.cs @ 50:3ebe89c88caa

Agregando propiedad al Evento sobre el Usuario que lo crea o que realizó la última modificación.
author nelopauselli
date Fri, 13 May 2011 23:29:05 -0300
parents e548379cc314
children 3059a5f8930f
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 {
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
8 [TestFixture]
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
9 public class TrackTests : TestBase
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
10 {
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
11 [Test]
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
12 public void Track_al_publicar_y_modificar_evento()
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
13 {
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
14 var repository = DefaultEventoRepository;
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
15
50
3ebe89c88caa Agregando propiedad al Evento sobre el Usuario que lo crea o que realizó la
nelopauselli
parents: 39
diff changeset
16 var agenda = new Agenda(null, null, repository, DefaultPonenteRepository);
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
17
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
18 var fecha = DateTime.Now.AddDays(5);
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
19 agenda.Publicar("Html 5", "jjmontes", fecha);
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
20 var evento = repository.GetEventosConFecha().First();
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
21
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
22 Assert.AreEqual(1, evento.Tracks.Count());
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
23 Assert.AreEqual(Accion.Publicar, evento.Tracks.Last().Accion);
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
24
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
25 agenda.ModificarEvento(evento.Id, "Html 5", "otro ponente", fecha);
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
26 Assert.AreEqual(2, evento.Tracks.Count());
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
27 Assert.AreEqual(Accion.Modificar, evento.Tracks.Last().Accion);
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
28
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
29 agenda.ModificarEvento(evento.Id, "Html 5 y Css 3", "otro ponente", fecha);
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
30 Assert.AreEqual(3, evento.Tracks.Count());
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
31 Assert.AreEqual(Accion.CambiarTitulo, evento.Tracks.Last().Accion);
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
32 }
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
33
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
34 [Test]
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
35 public void Track_al_publicar_y_realizar_evento()
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
36 {
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
37 var repository = DefaultEventoRepository;
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
38
50
3ebe89c88caa Agregando propiedad al Evento sobre el Usuario que lo crea o que realizó la
nelopauselli
parents: 39
diff changeset
39 var agenda = new Agenda(null, null, repository, DefaultPonenteRepository);
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
40
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
41 agenda.Publicar("Html 5", "jjmontes", DateTime.Now);
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
42 var evento = repository.GetEventosConFecha().First();
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
43
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
44 Assert.AreEqual(1, evento.Tracks.Count());
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
45 Assert.AreEqual(Accion.Publicar, evento.Tracks.Last().Accion);
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
46
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
47 agenda.RealizarEvento(evento.Id, "Esta es la sintesis");
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
48 Assert.AreEqual(2, evento.Tracks.Count());
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
49 Assert.AreEqual(Accion.Realizar, evento.Tracks.Last().Accion);
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
50 }
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
51
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
52 }
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
53 }