comparison Agendas/trunk/src/Agendas.Tests/TrackTests.cs @ 39:e548379cc314

track de cambios en evento
author nelo@MTEySS.neluz.int
date Fri, 18 Mar 2011 00:10:21 -0300
parents
children 3ebe89c88caa
comparison
equal deleted inserted replaced
38:3c5657d99727 39:e548379cc314
1 using System;
2 using System.Linq;
3 using AltNetHispano.Agendas.Domain;
4 using NUnit.Framework;
5
6 namespace AltNetHispano.Agendas.Tests
7 {
8 [TestFixture]
9 public class TrackTests : TestBase
10 {
11 [Test]
12 public void Track_al_publicar_y_modificar_evento()
13 {
14 var repository = DefaultEventoRepository;
15
16 var agenda = new Agenda(null, null, SeguridadServiceDefault, repository, DefaultPonenteRepository);
17
18 var fecha = DateTime.Now.AddDays(5);
19 agenda.Publicar("Html 5", "jjmontes", fecha);
20 var evento = repository.GetEventosConFecha().First();
21
22 Assert.AreEqual(1, evento.Tracks.Count());
23 Assert.AreEqual(Accion.Publicar, evento.Tracks.Last().Accion);
24
25 agenda.ModificarEvento(evento.Id, "Html 5", "otro ponente", fecha);
26 Assert.AreEqual(2, evento.Tracks.Count());
27 Assert.AreEqual(Accion.Modificar, evento.Tracks.Last().Accion);
28
29 agenda.ModificarEvento(evento.Id, "Html 5 y Css 3", "otro ponente", fecha);
30 Assert.AreEqual(3, evento.Tracks.Count());
31 Assert.AreEqual(Accion.CambiarTitulo, evento.Tracks.Last().Accion);
32 }
33
34 [Test]
35 public void Track_al_publicar_y_realizar_evento()
36 {
37 var repository = DefaultEventoRepository;
38
39 var agenda = new Agenda(null, null, SeguridadServiceDefault, repository, DefaultPonenteRepository);
40
41 agenda.Publicar("Html 5", "jjmontes", DateTime.Now);
42 var evento = repository.GetEventosConFecha().First();
43
44 Assert.AreEqual(1, evento.Tracks.Count());
45 Assert.AreEqual(Accion.Publicar, evento.Tracks.Last().Accion);
46
47 agenda.RealizarEvento(evento.Id, "Esta es la sintesis");
48 Assert.AreEqual(2, evento.Tracks.Count());
49 Assert.AreEqual(Accion.Realizar, evento.Tracks.Last().Accion);
50 }
51
52 }
53 }