annotate Agendas/trunk/src/Agendas.Twitter.Tests/Recordatorios_tests.cs @ 302:11dddcc9a862 tip

Historico de Eventos, no muestra bien la Url del Patrocinador.
author juanjose.montesdeocaarbos
date Tue, 14 Aug 2012 21:54:30 -0300
parents 72a96459f910
children
rev   line source
217
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
1 using System;
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
2 using System.Linq;
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
3 using AltNetHispano.Agendas.Domain;
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
4 using AltNetHispano.Agendas.Tests;
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
5 using AltNetHispano.Agendas.Twitter;
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
6 using NUnit.Framework;
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
7
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
8 namespace Agendas.Twitter.Tests
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
9 {
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
10 [TestFixture]
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
11 public class Recordatorios_tests : TestBase
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
12 {
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
13 [Test]
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
14 public void Recordar()
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
15 {
274
72a96459f910 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents: 235
diff changeset
16 var agenda = new Agenda(null, DefaultEventoRepository, DefaultPersonaRepository, DefaultPatrocinadorRepository);
217
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
17
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
18
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
19 var ponente = new Persona("Hernán García", string.Empty, "theprogrammer", string.Empty);
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
20 DefaultPersonaRepository.Save(ponente);
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
21
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
22 DateTime inicio=DateTime.Today.AddDays(7).AddHours(18);
235
c61954d24c8c Quitando ponente principal y utilizando siempre la lista de ponentes
nelopauselli
parents: 217
diff changeset
23 var resultado = agenda.Agendar("Node.js", new[]{ponente.Id}, inicio, inicio.AddHours(2), string.Empty, TipoEvento.Van);
217
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
24
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
25 Assert.IsTrue(resultado.Succeful);
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
26
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
27 var evento = DefaultEventoRepository.GetActivos().Single(e => e.Titulo == "Node.js");
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
28 Assert.IsNotNull(evento);
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
29
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
30 var recordatorios = new Recordatorios(evento);
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
31
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
32 Assert.IsNotNull(recordatorios);
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
33 Assert.AreEqual("Recuerde agendar el evento en twuffer u otro servicio similar.", recordatorios.Cabecera);
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
34 Assert.AreEqual("http://twuffer.com/", recordatorios.CabeceraLink);
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
35 Assert.IsNotNull(recordatorios.Items);
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
36 Assert.AreEqual(4, recordatorios.Items.Count);
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
37
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
38 Assert.AreEqual("La VAN sobre Node.js con @theprogrammer inicia en [3] horas 18GMT http://snipr.com/virtualaltnet", recordatorios.Items[0].Mensaje);
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
39 Assert.AreEqual(inicio.ToShortDateString(), recordatorios.Items[0].Fecha);
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
40 Assert.AreEqual("15:00", recordatorios.Items[0].Hora);
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
41
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
42 Assert.AreEqual("La VAN sobre Node.js con @theprogrammer inicia en [2] horas 18GMT http://snipr.com/virtualaltnet", recordatorios.Items[1].Mensaje);
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
43 Assert.AreEqual(inicio.ToShortDateString(), recordatorios.Items[1].Fecha);
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
44 Assert.AreEqual("16:00", recordatorios.Items[1].Hora);
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
45
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
46 Assert.AreEqual("La VAN sobre Node.js con @theprogrammer inicia en [1] hora 18GMT http://snipr.com/virtualaltnet", recordatorios.Items[2].Mensaje);
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
47 Assert.AreEqual(inicio.ToShortDateString(), recordatorios.Items[2].Fecha);
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
48 Assert.AreEqual("17:00", recordatorios.Items[2].Hora);
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
49
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
50 Assert.AreEqual("La VAN sobre Node.js con @theprogrammer inicia en [15] minutos 18GMT http://snipr.com/virtualaltnet", recordatorios.Items[3].Mensaje);
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
51 Assert.AreEqual(inicio.ToShortDateString(), recordatorios.Items[3].Fecha);
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
52 Assert.AreEqual("17:45", recordatorios.Items[3].Hora);
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
53 }
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
54 }
c4c60e034103 sugerencia de recordatorios
nelopauselli
parents:
diff changeset
55 }