Mercurial > altnet-hispano
diff Agendas/trunk/src/Agendas.Twitter.Tests/Publicador_tests.cs @ 271:e2c6610b14c7
Ticket #194: Error enviar twit cuando Cancela Evento. Test y Corrección.
author | juanjose.montesdeocaarbos |
---|---|
date | Fri, 11 Nov 2011 08:14:21 -0300 |
parents | 5cc1681d3789 |
children | 33e6ee3d1776 |
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Twitter.Tests/Publicador_tests.cs Wed Oct 26 09:31:17 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Twitter.Tests/Publicador_tests.cs Fri Nov 11 08:14:21 2011 -0300 @@ -134,5 +134,27 @@ adapter.Verify(a => a.Update(It.IsAny<string>(), out message), Times.Once()); } - } + + [Test] + public void Cancelar_evento() + { + var title = string.Format("Titulo: {0}{1}{2}{3}{4}{5}{6}", DateTime.Now.Year, DateTime.Now.Month, + DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second, DateTime.Now.Millisecond); + string twitt = null; + + var publicador = new TwitterPublicador(); + var agenda = new Agenda(publicador, DefaultEventoRepository, DefaultPersonaRepository); + var resultAgendar = agenda.Agendar(title, null, DateTime.Today.AddDays(8), DateTime.Today.AddDays(8).AddHours(2), string.Empty, TipoEvento.GrupoEstudio); + Assert.IsTrue(resultAgendar.Succeful); + + var evento = agenda.GetEventosActivos().Where(e => e.Titulo == title).FirstOrDefault(); + + agenda = new Agenda(publicador, DefaultEventoRepository, DefaultPersonaRepository); + var resultCancelar = agenda.Cancelar(evento.Id); + + Assert.IsTrue(resultCancelar.Succeful); + Assert.AreEqual(0, resultCancelar.Warnings.Count()); + } + + } } \ No newline at end of file