annotate Agendas/trunk/src/Agendas.Tests/TrackTests.cs @ 98:4895116b8232

subida del web service para escribir posts en el blog del portal
author jorge.rowies
date Sat, 04 Jun 2011 14:10:21 -0300
parents 26d0513a8410
children db4b1e2cae49
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
87
26d0513a8410 A los publicadores les llega la lista de tracks producidos en la acción realizada
nelopauselli
parents: 80
diff changeset
18 var agenda = new Agenda(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);
74
bc46e7426c80 Refactoring de acciones según la definición del diagrama de estados en assembla
nelopauselli
parents: 73
diff changeset
21 agenda.Agendar("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());
80
c2d98fd6593f Track como objeto identificable y con referencia al evento correspondiente.
nelopauselli
parents: 75
diff changeset
25 var ultimo = evento.Tracks.Last();
c2d98fd6593f Track como objeto identificable y con referencia al evento correspondiente.
nelopauselli
parents: 75
diff changeset
26 Assert.AreEqual(evento, ultimo.Evento);
c2d98fd6593f Track como objeto identificable y con referencia al evento correspondiente.
nelopauselli
parents: 75
diff changeset
27 Assert.AreEqual(Accion.Agendar, ultimo.Accion);
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
28
75
96d7609f2e08 Agendar evento propuesto
nelopauselli
parents: 74
diff changeset
29 agenda.ModificarEvento(evento.Id, "Html 5", "otro ponente", fecha, urlInvitacion);
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
30 Assert.AreEqual(2, evento.Tracks.Count());
80
c2d98fd6593f Track como objeto identificable y con referencia al evento correspondiente.
nelopauselli
parents: 75
diff changeset
31 ultimo = evento.Tracks.Last();
c2d98fd6593f Track como objeto identificable y con referencia al evento correspondiente.
nelopauselli
parents: 75
diff changeset
32 Assert.AreEqual(evento, ultimo.Evento);
c2d98fd6593f Track como objeto identificable y con referencia al evento correspondiente.
nelopauselli
parents: 75
diff changeset
33 Assert.AreEqual(Accion.Modificar, ultimo.Accion);
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
34
75
96d7609f2e08 Agendar evento propuesto
nelopauselli
parents: 74
diff changeset
35 agenda.ModificarEvento(evento.Id, "Html 5 y Css 3", "otro ponente", fecha, urlInvitacion);
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
36 Assert.AreEqual(3, evento.Tracks.Count());
80
c2d98fd6593f Track como objeto identificable y con referencia al evento correspondiente.
nelopauselli
parents: 75
diff changeset
37 ultimo = evento.Tracks.Last();
c2d98fd6593f Track como objeto identificable y con referencia al evento correspondiente.
nelopauselli
parents: 75
diff changeset
38 Assert.AreEqual(evento, ultimo.Evento);
c2d98fd6593f Track como objeto identificable y con referencia al evento correspondiente.
nelopauselli
parents: 75
diff changeset
39 Assert.AreEqual(Accion.CambiarTitulo, ultimo.Accion);
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
40 }
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
41
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
42 [Test]
73
76567a0d1e44 Eliminando algunas propiedades que no se estaban usando
nelopauselli
parents: 70
diff changeset
43 public void Track_al_publicar_y_confirmar_evento()
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
44 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
45 var repository = DefaultEventoRepository;
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
46
87
26d0513a8410 A los publicadores les llega la lista de tracks producidos en la acción realizada
nelopauselli
parents: 80
diff changeset
47 var agenda = new Agenda(null, repository, DefaultPonenteRepository);
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
48
74
bc46e7426c80 Refactoring de acciones según la definición del diagrama de estados en assembla
nelopauselli
parents: 73
diff changeset
49 agenda.Agendar("Html 5", "jjmontes", DateTime.Now,
70
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 54
diff changeset
50 urlInvitacion);
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
51 var evento = repository.GetEventosConFecha().First();
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
52
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
53 Assert.AreEqual(1, evento.Tracks.Count());
74
bc46e7426c80 Refactoring de acciones según la definición del diagrama de estados en assembla
nelopauselli
parents: 73
diff changeset
54 Assert.AreEqual(Accion.Agendar, evento.Tracks.Last().Accion);
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
55
73
76567a0d1e44 Eliminando algunas propiedades que no se estaban usando
nelopauselli
parents: 70
diff changeset
56 //TODO: confirmar evento y evaluar .tracks
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
57 }
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
58 }
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents:
diff changeset
59 }