Mercurial > altnet-hispano
changeset 188:49125b681709
Combinar
author | juanjose.montesdeocaarbos |
---|---|
date | Tue, 09 Aug 2011 08:55:08 -0300 |
parents | 37bc622980b4 (diff) 2d02adb79322 (current diff) |
children | fe47f11f5f20 03cf6a377ee8 |
files | Agendas/trunk/src/Agendas.Factories/AttributeFactory.cs Agendas/trunk/src/Agendas.Tests/Workflows/WorkflowTests.cs |
diffstat | 5 files changed, 68 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Google.Test/Agendas.Google.Test.csproj Tue Aug 09 01:04:27 2011 -0400 +++ b/Agendas/trunk/src/Agendas.Google.Test/Agendas.Google.Test.csproj Tue Aug 09 08:55:08 2011 -0300 @@ -57,6 +57,7 @@ </ItemGroup> <ItemGroup> <Compile Include="GCalendarTest.cs" /> + <Compile Include="GUrlShortenerTest.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="PublicadorTest.cs" /> </ItemGroup>
--- a/Agendas/trunk/src/Agendas.Google.Test/App.config Tue Aug 09 01:04:27 2011 -0400 +++ b/Agendas/trunk/src/Agendas.Google.Test/App.config Tue Aug 09 08:55:08 2011 -0300 @@ -10,4 +10,32 @@ <calendar userName="altnethispano.desa@gmail.com" password="fA&Ec3wU3est" calendarId="altnethispano.desa@gmail.com" /> </google> </publicadores> + + <system.serviceModel> + <client> + <endpoint address="https://www.googleapis.com/urlshortener/v1" + binding="webHttpBinding" + bindingConfiguration="webBinding" + behaviorConfiguration="urlShortener" + contract="GoogleAPI.UrlShortener.IUrlShortenerService" + name="UrlShortenerREST" /> + </client> + + <bindings> + <webHttpBinding> + <binding name="webBinding"> + <security mode="Transport"></security> + </binding> + </webHttpBinding> + </bindings> + + <behaviors> + <endpointBehaviors> + <behavior name="urlShortener"> + <webHttp /> + </behavior> + </endpointBehaviors> + </behaviors> + + </system.serviceModel> </configuration> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Google.Test/GUrlShortenerTest.cs Tue Aug 09 08:55:08 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); + } + } +}
--- a/Agendas/trunk/src/Agendas.Google/Agendas.Google.csproj Tue Aug 09 01:04:27 2011 -0400 +++ b/Agendas/trunk/src/Agendas.Google/Agendas.Google.csproj Tue Aug 09 08:55:08 2011 -0300 @@ -58,6 +58,7 @@ <Compile Include="DetailsEvents\VanGEventDetail.cs" /> <Compile Include="GCalendarAdapter.cs" /> <Compile Include="GooglePublicador.cs" /> + <Compile Include="GUrlShortener.cs" /> <Compile Include="IGCalendarAdapter.cs" /> <Compile Include="IGEventDetail.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Google/GUrlShortener.cs Tue Aug 09 08:55:08 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