annotate Agendas/trunk/src/Agendas.Tests/TrackTests.cs @ 70:c7264bfc4b71

agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden) modificaciones en proyecto Agendas.Blog modificacion de viewmodel EventoModel - agregado de UrlInvitacion (no requerido)
author jorge.rowies
date Fri, 20 May 2011 12:21:07 -0300
parents 3059a5f8930f
children 76567a0d1e44
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
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
18 var agenda = new Agenda(null, null, repository, DefaultPonenteRepository);
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);
70
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 54
diff changeset
21 agenda.Publicar("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());
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
25 Assert.AreEqual(Accion.Publicar, evento.Tracks.Last().Accion);
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
26
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
27 agenda.ModificarEvento(evento.Id, "Html 5", "otro ponente", fecha);
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
28 Assert.AreEqual(2, evento.Tracks.Count());
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
29 Assert.AreEqual(Accion.Modificar, evento.Tracks.Last().Accion);
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
30
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
31 agenda.ModificarEvento(evento.Id, "Html 5 y Css 3", "otro ponente", fecha);
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
32 Assert.AreEqual(3, evento.Tracks.Count());
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
33 Assert.AreEqual(Accion.CambiarTitulo, evento.Tracks.Last().Accion);
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
34 }
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
35
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
36 [Test]
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
37 public void Track_al_publicar_y_realizar_evento()
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
38 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
39 var repository = DefaultEventoRepository;
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 var agenda = new Agenda(null, null, repository, DefaultPonenteRepository);
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
42
70
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 54
diff changeset
43 agenda.Publicar("Html 5", "jjmontes", DateTime.Now,
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 54
diff changeset
44 urlInvitacion);
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
45 var evento = repository.GetEventosConFecha().First();
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 Assert.AreEqual(1, evento.Tracks.Count());
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
48 Assert.AreEqual(Accion.Publicar, evento.Tracks.Last().Accion);
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
49
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
50 agenda.RealizarEvento(evento.Id, "Esta es la sintesis");
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
51 Assert.AreEqual(2, evento.Tracks.Count());
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
52 Assert.AreEqual(Accion.Realizar, evento.Tracks.Last().Accion);
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
53 }
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
54 }
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
55 }