annotate Agendas/trunk/src/Agendas.Tests/TrackTests.cs @ 63:963b71ea6028

Repositorios con NH
author nelopauselli
date Tue, 17 May 2011 14:02:25 -0300
parents 3059a5f8930f
children c7264bfc4b71
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 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
11 [Test]
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
12 public void Track_al_publicar_y_modificar_evento()
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
13 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
14 var repository = DefaultEventoRepository;
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
15
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
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
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
18 var fecha = DateTime.Now.AddDays(5);
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
19 agenda.Publicar("Html 5", "jjmontes", fecha);
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
20 var evento = repository.GetEventosConFecha().First();
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
21
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
22 Assert.AreEqual(1, evento.Tracks.Count());
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
23 Assert.AreEqual(Accion.Publicar, evento.Tracks.Last().Accion);
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
24
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
25 agenda.ModificarEvento(evento.Id, "Html 5", "otro ponente", fecha);
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
26 Assert.AreEqual(2, evento.Tracks.Count());
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
27 Assert.AreEqual(Accion.Modificar, evento.Tracks.Last().Accion);
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
28
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
29 agenda.ModificarEvento(evento.Id, "Html 5 y Css 3", "otro ponente", fecha);
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
30 Assert.AreEqual(3, evento.Tracks.Count());
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
31 Assert.AreEqual(Accion.CambiarTitulo, evento.Tracks.Last().Accion);
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
32 }
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
33
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
34 [Test]
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
35 public void Track_al_publicar_y_realizar_evento()
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
36 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
37 var repository = DefaultEventoRepository;
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
38
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
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
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
41 agenda.Publicar("Html 5", "jjmontes", DateTime.Now);
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
42 var evento = repository.GetEventosConFecha().First();
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
43
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
44 Assert.AreEqual(1, evento.Tracks.Count());
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
45 Assert.AreEqual(Accion.Publicar, evento.Tracks.Last().Accion);
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
46
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
47 agenda.RealizarEvento(evento.Id, "Esta es la sintesis");
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
48 Assert.AreEqual(2, evento.Tracks.Count());
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
49 Assert.AreEqual(Accion.Realizar, evento.Tracks.Last().Accion);
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
50 }
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
51 }
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
52 }