# HG changeset patch # User juanjose.montesdeocaarbos # Date 1312890205 10800 # Node ID 71737419a8398ae15cccb3c89a63c45ddeeb3830 # Parent 3c70b0d8bd69539c4a80db14956bf1afdc2351f7 Ticket 143: Test de unidad, y algo de configuración para acortar URL con servicio de Google. diff -r 3c70b0d8bd69 -r 71737419a839 Agendas/trunk/src/Agendas.Google.Test/Agendas.Google.Test.csproj --- a/Agendas/trunk/src/Agendas.Google.Test/Agendas.Google.Test.csproj Mon Aug 08 06:17:19 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Google.Test/Agendas.Google.Test.csproj Tue Aug 09 08:43:25 2011 -0300 @@ -57,6 +57,7 @@ + diff -r 3c70b0d8bd69 -r 71737419a839 Agendas/trunk/src/Agendas.Google.Test/App.config --- a/Agendas/trunk/src/Agendas.Google.Test/App.config Mon Aug 08 06:17:19 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Google.Test/App.config Tue Aug 09 08:43:25 2011 -0300 @@ -10,4 +10,32 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 3c70b0d8bd69 -r 71737419a839 Agendas/trunk/src/Agendas.Google.Test/GUrlShortenerTest.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Google.Test/GUrlShortenerTest.cs Tue Aug 09 08:43:25 2011 -0300 @@ -0,0 +1,20 @@ +using AltNetHispano.Agendas.Google; +using NUnit.Framework; + +namespace Agendas.Google.Test +{ + [TestFixture] + [Explicit] + public class GUrlShortenerTest + { + [Test] + public void Obtener_Url_corta() + { + var gUrlShortener = new GUrlShortener(); + + var shortUrl = gUrlShortener.GetShortUrl("http://www.twitter.com"); + + Assert.AreEqual("http://goo.gl/CbHS", shortUrl); + } + } +} diff -r 3c70b0d8bd69 -r 71737419a839 Agendas/trunk/src/Agendas.Google/GUrlShortener.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Google/GUrlShortener.cs Tue Aug 09 08:43:25 2011 -0300 @@ -0,0 +1,18 @@ +using System; +//using GoogleAPI.UrlShortener; + +namespace AltNetHispano.Agendas.Google +{ + public class GUrlShortener + { + public string GetShortUrl(string url) + { + //TODO: Esto es utilizando la GoogleAPI.UrlShortener. + //var client = new UrlResource(); + //var response = client.Insert(new ShortenRequest { LongUrl = url }); + + //return response.Id; + throw new NotImplementedException(); + } + } +} \ No newline at end of file