changeset 191:03c237cd5cc4

Test que verifica el acceso por shorten url
author nelopauselli
date Tue, 09 Aug 2011 09:52:02 -0300
parents e6abe8e1a794
children 523e3586b1c1
files Agendas/trunk/src/Agendas.Google.Test/GUrlShortenerTest.cs
diffstat 1 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Google.Test/GUrlShortenerTest.cs	Tue Aug 09 09:45:07 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Google.Test/GUrlShortenerTest.cs	Tue Aug 09 09:52:02 2011 -0300
@@ -1,4 +1,5 @@
 using System;
+using System.Net;
 using AltNetHispano.Agendas.Google;
 using NUnit.Framework;
 
@@ -18,5 +19,24 @@
 
 			Assert.AreEqual("http://goo.gl/CbHS", shortUrl);
 		}
+
+		[Test]
+		public void Acceder_a_url_corta()
+		{
+			var gUrlShortener = new GUrlShortenerAdapter();
+
+			var shortUrl = gUrlShortener.GetShortUrl("http://altnethispano.org");
+
+			Console.WriteLine(shortUrl);
+
+			var request = WebRequest.Create(shortUrl);
+			var response = request.GetResponse() as HttpWebResponse;
+
+			Assert.IsNotNull(response);
+			Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
+
+			Assert.AreEqual(new Uri("http://altnethispano.org/Inicio.aspx"), response.ResponseUri);
+
+		}
 	}
 }