diff 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
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Twitter.Tests/Publicador_tests.cs	Wed Sep 28 19:19:33 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Twitter.Tests/Publicador_tests.cs	Wed Sep 28 20:02:44 2011 -0300
@@ -102,5 +102,35 @@
 			adapter.Verify(a => a.Update(It.IsAny<string>(), out message), Times.Exactly(2));
 
 		}
+
+		[Test]
+		public void Evento_sin_ponente()
+		{
+			var adapter = new Mock<ITwitterAdapter>();
+
+			string message;
+			var twitters = new List<string>();
+			adapter.Setup(a => a.Update(It.IsAny<string>(), out message)).Returns(true).Callback<string, string>((status, m) => twitters.Add(status));
+
+			var publicador = new TwitterPublicador(adapter.Object);
+			var agenda = new Agenda(publicador, DefaultEventoRepository, DefaultPersonaRepository);
+
+			var inicio = DateTime.Now.AddDays(3);
+
+			agenda.Agendar("Identity Providers Públicos y Empresariales", Guid.Empty, inicio, inicio.AddHours(2), null, TipoEvento.Cafe);
+
+			Assert.IsTrue(twitters.Any());
+			var joined = string.Empty;
+			foreach (var twitter in twitters)
+			{
+				Console.WriteLine(twitter);
+				Assert.LessOrEqual(twitter.Length, 140);
+				joined += twitter;
+			}
+			Assert.AreEqual("Se ha agendando el evento Identity Providers Públicos y Empresariales para el 01/10/2011 por http://snipr.com/virtualaltnet", joined);
+
+			adapter.Verify(a => a.Update(It.IsAny<string>(), out message), Times.Once());
+
+		}
 	}
 }
\ No newline at end of file