changeset 234:cc71f96ac134

Combinar
author juanjose.montesdeocaarbos
date Tue, 04 Oct 2011 20:36:27 -0300
parents 32e4e0e7a140 (diff) e5959f3405e0 (current diff)
children 04d6b386afa7 717fce60f200
files
diffstat 6 files changed, 192 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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<ArgumentException>(() => gUrlShortener.GetShortUrl(string.Empty));
+            Assert.Throws<ArgumentNullException>(() => gUrlShortener.GetShortUrl(null));
+        }
+    }
 }
--- 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";
--- 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 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="NHibernate.ByteCode.Castle">
+      <HintPath>..\packages\NHibernate.Castle.3.1.0.4000\lib\Net35\NHibernate.ByteCode.Castle.dll</HintPath>
+    </Reference>
     <Reference Include="nunit.framework">
       <HintPath>..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll</HintPath>
     </Reference>
@@ -45,6 +48,7 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="AutorizationsTests.cs" />
+    <Compile Include="Controllers\EventoControllerTests.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
   <ItemGroup>
@@ -57,6 +61,19 @@
       <Name>Agendas.Web</Name>
     </ProjectReference>
   </ItemGroup>
+  <ItemGroup>
+    <None Include="App_.config">
+      <SubType>Designer</SubType>
+    </None>
+    <Content Include="App.config">
+      <SubType>Designer</SubType>
+    </Content>
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="hibernate.cfg.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Agendas/trunk/src/Agendas.Web.Tests/App.config	Tue Oct 04 20:36:27 2011 -0300
@@ -0,0 +1,103 @@
+<?xml version="1.0"?>
+<!--
+  For more information on how to configure your ASP.NET application, please visit
+  http://go.microsoft.com/fwlink/?LinkId=152368
+  -->
+
+<configuration>
+	<configSections>
+		<section name="publicadores" type="AltNetHispano.Agendas.Configurations.PublicadoresConfigurationSection, AltNetHispano.Agendas.Configurations, Version=1.0.0.0, Culture=neutral" />
+	</configSections>
+
+	<connectionStrings>
+		<add name="AltNetHispano" connectionString="Data Source=.\sqlexpress;Initial Catalog=AltNetHispano_Test;Integrated Security=SSPI"/>
+	</connectionStrings>
+
+	<appSettings>
+		<add key="ClientValidationEnabled" value="true"/>
+		<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
+	</appSettings>
+
+	<system.web>
+		<customErrors mode="Off"/>
+		<compilation debug="true" targetFramework="4.0">
+			<assemblies>
+				<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
+				<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
+				<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
+				<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
+				<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
+			</assemblies>
+		</compilation>
+
+		<authentication mode="Forms">
+			<forms loginUrl="~/Account/LogOn" timeout="2880" />
+		</authentication>
+
+		<membership>
+			<providers>
+				<clear/>
+				<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
+					 enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
+					 maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
+					 applicationName="altnet-hispano.agenda" />
+			</providers>
+		</membership>
+
+		<profile>
+			<providers>
+				<clear/>
+				<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
+			</providers>
+		</profile>
+
+		<roleManager enabled="false">
+			<providers>
+				<clear/>
+				<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
+				<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
+			</providers>
+		</roleManager>
+
+		<pages>
+			<namespaces>
+				<clear/>
+				<add namespace="System.Web.Helpers" />
+				<add namespace="System.Web.Mvc" />
+				<add namespace="System.Web.Mvc.Ajax" />
+				<add namespace="System.Web.Mvc.Html" />
+				<add namespace="System.Web.Routing" />
+				<add namespace="System.Web.WebPages"/>
+			</namespaces>
+		</pages>
+
+    <globalization culture="es-ES" />
+	</system.web>
+
+	<system.webServer>
+		<validation validateIntegratedModeConfiguration="false"/>
+		<modules runAllManagedModulesForAllRequests="true"/>
+	</system.webServer>
+
+	<runtime>
+		<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+			<dependentAssembly>
+				<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
+				<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
+			</dependentAssembly>
+		</assemblyBinding>
+	</runtime>
+
+	<publicadores>
+		<twitter enabled="false">
+			<signIn consumerKey="uUSzC5EZ2LCNoBmaQXcUFA" consumerSecret="CNN2uUwza4nGNoZf3FlAqC0xoUEKXKFWxZn3Frow" />
+			<sendTwitter consumerKey="UpwG7RKRAqQfdsCKnBfHA" consumerSecret="HIOb9tMewejyFX97mhsQO2FXSEQN4kzJFF6iQLx4k" accessToken="301500900-1GGyiecfAgmbrJMEcjp4XA9KXEJU2bBLyEQNQL5S" accessTokenSecret="46vNqg4djzyh9GRtZoUv0c7uEl7mQ3CjVBeJ4wwRpds"/>
+		</twitter>
+		<google enabled="false">
+			<calendar userName="altnethispano.desa@gmail.com" password="fA&amp;Ec3wU3est" calendarId="altnethispano.desa@gmail.com" />
+		</google>
+		<blog enabled="false">
+			<writer postWriterServiceUrl="http://dummy/dummy.aspx" blogName="dummy" blogWriterMasterKey="dummy" />
+		</blog>
+	</publicadores>
+</configuration>
\ No newline at end of file
--- /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);
+        }
+    }
+}
--- /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 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<hibernate-configuration  xmlns="urn:nhibernate-configuration-2.2" >
+	<session-factory>
+		<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
+		<property name="connection.connection_string_name">AltNetHispano</property>
+		<property name="dialect">NHibernate.Dialect.MsSql2008Dialect</property>
+
+		<property name="current_session_context_class">web</property>
+		<property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>
+	</session-factory>
+</hibernate-configuration>
\ No newline at end of file