comparison Agendas/trunk/src/Agendas.Twitter.Tests/Publicador_tests.cs @ 231:e5959f3405e0

Eventos sin ponentes
author nelopauselli
date Wed, 28 Sep 2011 20:02:44 -0300
parents 33976aea7546
children c61954d24c8c 01a9b47185eb
comparison
equal deleted inserted replaced
230:e38d53a1ead9 231:e5959f3405e0
100 Assert.AreEqual("...por http://snipr.com/virtualaltnet", twitters.Last()); 100 Assert.AreEqual("...por http://snipr.com/virtualaltnet", twitters.Last());
101 101
102 adapter.Verify(a => a.Update(It.IsAny<string>(), out message), Times.Exactly(2)); 102 adapter.Verify(a => a.Update(It.IsAny<string>(), out message), Times.Exactly(2));
103 103
104 } 104 }
105
106 [Test]
107 public void Evento_sin_ponente()
108 {
109 var adapter = new Mock<ITwitterAdapter>();
110
111 string message;
112 var twitters = new List<string>();
113 adapter.Setup(a => a.Update(It.IsAny<string>(), out message)).Returns(true).Callback<string, string>((status, m) => twitters.Add(status));
114
115 var publicador = new TwitterPublicador(adapter.Object);
116 var agenda = new Agenda(publicador, DefaultEventoRepository, DefaultPersonaRepository);
117
118 var inicio = DateTime.Now.AddDays(3);
119
120 agenda.Agendar("Identity Providers Públicos y Empresariales", Guid.Empty, inicio, inicio.AddHours(2), null, TipoEvento.Cafe);
121
122 Assert.IsTrue(twitters.Any());
123 var joined = string.Empty;
124 foreach (var twitter in twitters)
125 {
126 Console.WriteLine(twitter);
127 Assert.LessOrEqual(twitter.Length, 140);
128 joined += twitter;
129 }
130 Assert.AreEqual("Se ha agendando el evento Identity Providers Públicos y Empresariales para el 01/10/2011 por http://snipr.com/virtualaltnet", joined);
131
132 adapter.Verify(a => a.Update(It.IsAny<string>(), out message), Times.Once());
133
134 }
105 } 135 }
106 } 136 }