# HG changeset patch # User nelopauselli # Date 1317771766 10800 # Node ID 04d6b386afa7fbadabb182a8f6a49a186bbd0086 # Parent c61954d24c8c7d09ebbb9473164fc2e603e17dcf# Parent cc71f96ac1348edd61b78a9ee3a7735448db8f40 Merge diff -r c61954d24c8c -r 04d6b386afa7 Agendas/trunk/src/Agendas.Google.Test/GUrlShortenerTest.cs --- a/Agendas/trunk/src/Agendas.Google.Test/GUrlShortenerTest.cs Tue Oct 04 20:42:35 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Google.Test/GUrlShortenerTest.cs Tue Oct 04 20:42:46 2011 -0300 @@ -38,5 +38,14 @@ Assert.AreEqual(new Uri("http://altnethispano.org/Inicio.aspx"), response.ResponseUri); } - } + + [Test] + public void Parametros_Invalidos_En_GetShortUrl() + { + var gUrlShortener = new GUrlShortenerAdapter(); + + Assert.Throws(() => gUrlShortener.GetShortUrl(string.Empty)); + Assert.Throws(() => gUrlShortener.GetShortUrl(null)); + } + } } diff -r c61954d24c8c -r 04d6b386afa7 Agendas/trunk/src/Agendas.Google/GUrlShortenerAdapter.cs --- a/Agendas/trunk/src/Agendas.Google/GUrlShortenerAdapter.cs Tue Oct 04 20:42:35 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Google/GUrlShortenerAdapter.cs Tue Oct 04 20:42:46 2011 -0300 @@ -1,4 +1,5 @@ -using System.IO; +using System; +using System.IO; using System.Net; using AltNetHispano.Agendas.Configurations; @@ -15,6 +16,11 @@ public string GetShortUrl(string url) { + if (url == null) + throw new ArgumentNullException("url"); + else if (string.IsNullOrWhiteSpace(url)) + throw new ArgumentException(); + WebRequest request = WebRequest.Create(_config.UrlAPI); request.Method = WebRequestMethods.Http.Post; request.ContentType = "application/json"; diff -r c61954d24c8c -r 04d6b386afa7 Agendas/trunk/src/Agendas.Web.Tests/Agendas.Web.Tests.csproj --- a/Agendas/trunk/src/Agendas.Web.Tests/Agendas.Web.Tests.csproj Tue Oct 04 20:42:35 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web.Tests/Agendas.Web.Tests.csproj Tue Oct 04 20:42:46 2011 -0300 @@ -31,6 +31,9 @@ 4 + + ..\packages\NHibernate.Castle.3.1.0.4000\lib\Net35\NHibernate.ByteCode.Castle.dll + ..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll @@ -45,6 +48,7 @@ + @@ -57,6 +61,19 @@ Agendas.Web + + + Designer + + + Designer + + + + + Always + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r c61954d24c8c -r 04d6b386afa7 Agendas/trunk/src/Agendas.Web.Tests/Controllers/EventoControllerTests.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Web.Tests/Controllers/EventoControllerTests.cs Tue Oct 04 20:42:46 2011 -0300 @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using AltNetHispano.Agendas.Domain; +using AltNetHispano.Agendas.Web.Controllers; +using AltNetHispano.Agendas.Web.Models; +using NUnit.Framework; + +namespace Agendas.Web.Tests.Controllers +{ + [TestFixture] + public class EventoControllerTests + { + [Test] + [Ignore] + public void Publicar_Evento() + { + var eventoController = new EventoController(); + + var eventoNew = new EventoNewModel + { + Duracion = new TimeSpan(0, 0, 0), + Fecha = DateTime.Today.AddDays(5), + Hora = new TimeSpan(18, 0, 0), + Ponente = new Guid(), + TipoEvento = (int)TipoEvento.Van, + Titulo = "Título 1" + }; + + var resultNuevo = eventoController.Nuevo(eventoNew); + + //var eventoPublicar = new EventoPublicarModel + // { + // NroOrden = 1, + // Titulo = "Título 1", + // UrlWiki = "http://www.altnethistpano.org/vans/titulo-1.ashx", + // DuracionReal = new TimeSpan() + // }; + + //var resultPublicar = eventoController.Publicar(eventoPublicar); + } + } +} diff -r c61954d24c8c -r 04d6b386afa7 Agendas/trunk/src/Agendas.Web.Tests/hibernate.cfg.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Web.Tests/hibernate.cfg.xml Tue Oct 04 20:42:46 2011 -0300 @@ -0,0 +1,11 @@ + + + + NHibernate.Driver.SqlClientDriver + AltNetHispano + NHibernate.Dialect.MsSql2008Dialect + + web + NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle + + \ No newline at end of file