# HG changeset patch # User Nelo@Kenia.neluz.int # Date 1307498826 10800 # Node ID 786a90e26c9b542a96935f3d10bf6677bf0f1fd8 # Parent 1ee5711256db4bf78965f264bf912045500ffba7 Los tests ya twittean con la cuenta de altnet-hispano-desa diff -r 1ee5711256db -r 786a90e26c9b Agendas/trunk/src/Agendas.Twitter.Tests/Agendas.Twitter.Tests.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Twitter.Tests/Agendas.Twitter.Tests.csproj Tue Jun 07 23:07:06 2011 -0300 @@ -0,0 +1,83 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {462D86DD-7F4D-4596-B18B-2DD92C7FD73F} + Library + Properties + Agendas.Twitter.Tests + Agendas.Twitter.Tests + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Newtonsoft.Json.3.5.8\lib\35\Newtonsoft.Json.dll + + + ..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll + + + ..\packages\NUnit.2.5.10.11092\lib\nunit.mocks.dll + + + ..\packages\NUnit.2.5.10.11092\lib\pnunit.framework.dll + + + + + + + + + + ..\packages\twitterizer.2.3.2\lib\Twitterizer2.dll + + + + + + + + + + + + + {A14907DF-02E4-4FA7-BE27-4292AF50AA22} + Agendas.Domain + + + {D8DA7ED2-A274-4DF6-9DD2-A9DC65F4C2F5} + Agendas.Twitter + + + + + \ No newline at end of file diff -r 1ee5711256db -r 786a90e26c9b Agendas/trunk/src/Agendas.Twitter.Tests/App.config --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Twitter.Tests/App.config Tue Jun 07 23:07:06 2011 -0300 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 1ee5711256db -r 786a90e26c9b Agendas/trunk/src/Agendas.Twitter.Tests/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Twitter.Tests/Properties/AssemblyInfo.cs Tue Jun 07 23:07:06 2011 -0300 @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Agendas.Twitter.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Agendas.Twitter.Tests")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("fb277dd8-af44-4be7-a300-70902bb2de61")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff -r 1ee5711256db -r 786a90e26c9b Agendas/trunk/src/Agendas.Twitter.Tests/Send_twitt_tests.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Twitter.Tests/Send_twitt_tests.cs Tue Jun 07 23:07:06 2011 -0300 @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Text; +using AltNetHispano.Agendas.Twitter; +using NUnit.Framework; +using Twitterizer; + +namespace Agendas.Twitter.Tests +{ + [TestFixture] + public class Send_twitt_tests + { + [Test] + public void Send_twitt() + { + var p = new TwitterPublicador(); + + string message; + var r = p.Publicar("Hello, #Twitterizer", out message); + + Console.WriteLine(message); + Assert.IsTrue(r); + } + } +} \ No newline at end of file diff -r 1ee5711256db -r 786a90e26c9b Agendas/trunk/src/Agendas.Twitter.Tests/packages.config --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Twitter.Tests/packages.config Tue Jun 07 23:07:06 2011 -0300 @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff -r 1ee5711256db -r 786a90e26c9b Agendas/trunk/src/Agendas.Twitter/TwitterPublicador.cs --- a/Agendas/trunk/src/Agendas.Twitter/TwitterPublicador.cs Tue Jun 07 21:03:56 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Twitter/TwitterPublicador.cs Tue Jun 07 23:07:06 2011 -0300 @@ -1,14 +1,55 @@ using System; using System.Collections.Generic; +using System.Configuration; using AltNetHispano.Agendas.Domain; +using Twitterizer; namespace AltNetHispano.Agendas.Twitter { public class TwitterPublicador : IPublicador { + private string ConsumerKey + { + get { return ConfigurationManager.AppSettings["consumerKey"]; } + } + + private string ConsumerSecret + { + get { return ConfigurationManager.AppSettings["consumerSecret"]; } + } + + + private string AccessToken + { + get { return ConfigurationManager.AppSettings["accessToken"]; } + } + + + private string AccessTokenSecret + { + get { return ConfigurationManager.AppSettings["accessTokenSecret"]; } + } + public void Publicar(IEnumerable tracks) { throw new NotImplementedException(); } + + public bool Publicar (string status, out string message) + { + var tokens = new OAuthTokens + { + ConsumerKey = ConsumerKey, + ConsumerSecret = ConsumerSecret, + AccessToken = AccessToken, + AccessTokenSecret = AccessTokenSecret + }; + + var response = TwitterStatus.Update(tokens, status); + + message = response.ErrorMessage; + return response.Result == RequestResult.Success; + + } } } \ No newline at end of file diff -r 1ee5711256db -r 786a90e26c9b Agendas/trunk/src/Agendas.sln --- a/Agendas/trunk/src/Agendas.sln Tue Jun 07 21:03:56 2011 -0300 +++ b/Agendas/trunk/src/Agendas.sln Tue Jun 07 23:07:06 2011 -0300 @@ -30,6 +30,8 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Agendas.Resources", "Agendas.Resources\Agendas.Resources.csproj", "{444D25FB-FC1C-48DC-9EAD-D4C78F2A10CA}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Agendas.Twitter.Tests", "Agendas.Twitter.Tests\Agendas.Twitter.Tests.csproj", "{462D86DD-7F4D-4596-B18B-2DD92C7FD73F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -80,6 +82,10 @@ {444D25FB-FC1C-48DC-9EAD-D4C78F2A10CA}.Debug|Any CPU.Build.0 = Debug|Any CPU {444D25FB-FC1C-48DC-9EAD-D4C78F2A10CA}.Release|Any CPU.ActiveCfg = Release|Any CPU {444D25FB-FC1C-48DC-9EAD-D4C78F2A10CA}.Release|Any CPU.Build.0 = Release|Any CPU + {462D86DD-7F4D-4596-B18B-2DD92C7FD73F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {462D86DD-7F4D-4596-B18B-2DD92C7FD73F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {462D86DD-7F4D-4596-B18B-2DD92C7FD73F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {462D86DD-7F4D-4596-B18B-2DD92C7FD73F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff -r 1ee5711256db -r 786a90e26c9b Agendas/trunk/src/install packages.bat --- a/Agendas/trunk/src/install packages.bat Tue Jun 07 21:03:56 2011 -0300 +++ b/Agendas/trunk/src/install packages.bat Tue Jun 07 23:07:06 2011 -0300 @@ -3,5 +3,6 @@ ..\tools\nuget i Agendas.NHibernate\packages.config -o packages ..\tools\nuget i Agendas.Web\packages.config -o packages ..\tools\nuget i Agendas.Twitter\packages.config -o packages +..\tools\nuget i Agendas.Twitter.Tests\packages.config -o packages PAUSE \ No newline at end of file