39
|
1 using System;
|
|
2 using System.Linq;
|
|
3 using AltNetHispano.Agendas.Domain;
|
|
4 using NUnit.Framework;
|
|
5
|
|
6 namespace AltNetHispano.Agendas.Tests
|
|
7 {
|
54
|
8 [TestFixture]
|
|
9 public class TrackTests : TestBase
|
|
10 {
|
|
11 [Test]
|
|
12 public void Track_al_publicar_y_modificar_evento()
|
|
13 {
|
|
14 var repository = DefaultEventoRepository;
|
39
|
15
|
54
|
16 var agenda = new Agenda(null, null, repository, DefaultPonenteRepository);
|
39
|
17
|
54
|
18 var fecha = DateTime.Now.AddDays(5);
|
|
19 agenda.Publicar("Html 5", "jjmontes", fecha);
|
|
20 var evento = repository.GetEventosConFecha().First();
|
39
|
21
|
54
|
22 Assert.AreEqual(1, evento.Tracks.Count());
|
|
23 Assert.AreEqual(Accion.Publicar, evento.Tracks.Last().Accion);
|
39
|
24
|
54
|
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);
|
39
|
28
|
54
|
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 }
|
39
|
33
|
54
|
34 [Test]
|
|
35 public void Track_al_publicar_y_realizar_evento()
|
|
36 {
|
|
37 var repository = DefaultEventoRepository;
|
39
|
38
|
54
|
39 var agenda = new Agenda(null, null, repository, DefaultPonenteRepository);
|
39
|
40
|
54
|
41 agenda.Publicar("Html 5", "jjmontes", DateTime.Now);
|
|
42 var evento = repository.GetEventosConFecha().First();
|
39
|
43
|
54
|
44 Assert.AreEqual(1, evento.Tracks.Count());
|
|
45 Assert.AreEqual(Accion.Publicar, evento.Tracks.Last().Accion);
|
39
|
46
|
54
|
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 }
|
39
|
52 } |