# HG changeset patch # User juanjose.montesdeocaarbos # Date 1317771387 10800 # Node ID cc71f96ac1348edd61b78a9ee3a7735448db8f40 # Parent 32e4e0e7a140fd3a033c2dd292d5b05502e4faaa# Parent e5959f3405e0ab9554847ae77f72952b4e0d0dbb Combinar diff -r e5959f3405e0 -r cc71f96ac134 Agendas/trunk/src/Agendas.Google.Test/GUrlShortenerTest.cs --- a/Agendas/trunk/src/Agendas.Google.Test/GUrlShortenerTest.cs Wed Sep 28 20:02:44 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Google.Test/GUrlShortenerTest.cs Tue Oct 04 20:36:27 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 e5959f3405e0 -r cc71f96ac134 Agendas/trunk/src/Agendas.Google/GUrlShortenerAdapter.cs --- a/Agendas/trunk/src/Agendas.Google/GUrlShortenerAdapter.cs Wed Sep 28 20:02:44 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Google/GUrlShortenerAdapter.cs Tue Oct 04 20:36:27 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 e5959f3405e0 -r cc71f96ac134 Agendas/trunk/src/Agendas.Web.Tests/Agendas.Web.Tests.csproj --- a/Agendas/trunk/src/Agendas.Web.Tests/Agendas.Web.Tests.csproj Wed Sep 28 20:02:44 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web.Tests/Agendas.Web.Tests.csproj Tue Oct 04 20:36:27 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 e5959f3405e0 -r cc71f96ac134 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:36:27 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 e5959f3405e0 -r cc71f96ac134 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:36:27 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