Permalink
Browse files

rtm.auth.getTokenの実装

  • Loading branch information...
1 parent dbc7c27 commit 61a4caae20048f00e0a6bb9dfa0c102373b83f97 @masaru-b-cl committed Apr 24, 2012
Showing with 5,989 additions and 168 deletions.
  1. BIN ReactiveTheMilk.Test/MolesAssemblies/ReactiveTheMilk.Moles.dll
  2. +200 −4 ReactiveTheMilk.Test/MolesAssemblies/ReactiveTheMilk.Moles.xml
  3. +5 −4 ReactiveTheMilk.Test/ReactiveTheMilk.Test.csproj
  4. +62 −26 ReactiveTheMilk.Test/RtmAuthorizerTest.cs
  5. +4 −4 ReactiveTheMilk.Test/RtmBaseTest.cs
  6. +2 −2 ReactiveTheMilk.Test/packages.config
  7. +8 −5 ReactiveTheMilk/ReactiveTheMilk.csproj
  8. +43 −19 ReactiveTheMilk/RtmAuthorizer.cs
  9. +89 −89 ReactiveTheMilk/RtmBase.cs
  10. +14 −0 ReactiveTheMilk/RtmToken.cs
  11. +14 −0 ReactiveTheMilk/RtmUser.cs
  12. +2 −2 ReactiveTheMilk/packages.config
  13. BIN packages/ReactiveProperty.0.3.1.0/ReactiveProperty.0.3.1.0.nupkg
  14. BIN packages/ReactiveProperty.0.3.1.0/lib/NET40/CodeContracts/ReactiveProperty.NET40.Contracts.dll
  15. BIN packages/ReactiveProperty.0.3.1.0/lib/NET40/ReactiveProperty.NET40.dll
  16. BIN packages/ReactiveProperty.0.3.1.0/lib/SL4-WindowsPhone71/ReactiveProperty.WP7.Rx-Main.dll
  17. BIN packages/ReactiveProperty.0.3.1.0/lib/SL4/CodeContracts/ReactiveProperty.SL4.Contracts.dll
  18. BIN packages/ReactiveProperty.0.3.1.0/lib/SL4/ReactiveProperty.SL4.dll
  19. BIN packages/ReactiveProperty.0.3.1.0/lib/SL5/CodeContracts/ReactiveProperty.SL5.Contracts.dll
  20. BIN packages/ReactiveProperty.0.3.1.0/lib/SL5/ReactiveProperty.SL5.dll
  21. BIN packages/ReactiveProperty.0.3.2.0/ReactiveProperty.0.3.2.0.nupkg
  22. +11 −1 packages/{ReactiveProperty.0.3.1.0 → ReactiveProperty.0.3.2.0}/docs/ReadMe.txt
  23. BIN packages/ReactiveProperty.0.3.2.0/lib/NET40/CodeContracts/ReactiveProperty.NET40.Contracts.dll
  24. +14 −0 packages/{ReactiveProperty.0.3.1.0 → ReactiveProperty.0.3.2.0}/lib/NET40/ReactiveProperty.NET40.XML
  25. BIN packages/ReactiveProperty.0.3.2.0/lib/NET40/ReactiveProperty.NET40.dll
  26. BIN .../{ReactiveProperty.0.3.1.0 → ReactiveProperty.0.3.2.0}/lib/NET40/System.Windows.Interactivity.dll
  27. BIN packages/ReactiveProperty.0.3.2.0/lib/SL4-WindowsPhone71/ReactiveProperty.WP7.Rx-Main.dll
  28. +14 −0 ...perty.0.3.1.0 → ReactiveProperty.0.3.2.0}/lib/SL4-WindowsPhone71/ReactiveProperty.WP7.Rx-Main.xml
  29. BIN ...perty.0.3.1.0 → ReactiveProperty.0.3.2.0}/lib/SL4-WindowsPhone71/System.Windows.Interactivity.dll
  30. BIN packages/ReactiveProperty.0.3.2.0/lib/SL4/CodeContracts/ReactiveProperty.SL4.Contracts.dll
  31. +15 −11 ...1.0/lib/SL5/ReactiveProperty.SL5.XML → ReactiveProperty.0.3.2.0/lib/SL4/ReactiveProperty.SL4.XML}
  32. BIN packages/ReactiveProperty.0.3.2.0/lib/SL4/ReactiveProperty.SL4.dll
  33. BIN ...tiveProperty.0.3.1.0/lib/SL5 → ReactiveProperty.0.3.2.0/lib/SL4}/System.Windows.Interactivity.dll
  34. BIN packages/ReactiveProperty.0.3.2.0/lib/SL5/CodeContracts/ReactiveProperty.SL5.Contracts.dll
  35. +25 −1 ...1.0/lib/SL4/ReactiveProperty.SL4.XML → ReactiveProperty.0.3.2.0/lib/SL5/ReactiveProperty.SL5.XML}
  36. BIN packages/ReactiveProperty.0.3.2.0/lib/SL5/ReactiveProperty.SL5.dll
  37. BIN ...tiveProperty.0.3.1.0/lib/SL4 → ReactiveProperty.0.3.2.0/lib/SL5}/System.Windows.Interactivity.dll
  38. 0 packages/{ReactiveProperty.0.3.1.0 → ReactiveProperty.0.3.2.0}/snippets/ReactiveCollection.snippet
  39. 0 packages/{ReactiveProperty.0.3.1.0 → ReactiveProperty.0.3.2.0}/snippets/ReactiveCommand.snippet
  40. 0 ...ges/{ReactiveProperty.0.3.1.0 → ReactiveProperty.0.3.2.0}/snippets/ReactiveCommandGeneric.snippet
  41. 0 packages/{ReactiveProperty.0.3.1.0 → ReactiveProperty.0.3.2.0}/snippets/ReactiveProperty.snippet
  42. BIN packages/Rx-Main.1.0.10621/Rx-Main.1.0.10621.nupkg
  43. BIN packages/Rx-Main.1.0.10621/lib/Net35/System.Reactive.dll
  44. BIN packages/Rx-Main.1.0.10621/lib/Net4/System.Reactive.dll
  45. BIN packages/Rx-Main.1.0.10621/lib/SL3-WP/System.Reactive.dll
  46. BIN packages/Rx-Main.1.0.10621/lib/SL4/System.Reactive.dll
  47. BIN packages/Rx-Main.1.0.11226/Rx-Main.1.0.11226.nupkg
  48. +9 −0 packages/{Rx-Main.1.0.10621 → Rx-Main.1.0.11226}/lib/Net35/System.Reactive.XML
  49. BIN packages/Rx-Main.1.0.11226/lib/Net35/System.Reactive.dll
  50. +9 −0 packages/{Rx-Main.1.0.10621 → Rx-Main.1.0.11226}/lib/Net4/System.Reactive.XML
  51. BIN packages/Rx-Main.1.0.11226/lib/Net4/System.Reactive.dll
  52. +9 −0 packages/{Rx-Main.1.0.10621 → Rx-Main.1.0.11226}/lib/SL3-WP/System.Reactive.XML
  53. BIN packages/Rx-Main.1.0.11226/lib/SL3-WP/System.Reactive.dll
  54. +9 −0 packages/{Rx-Main.1.0.10621 → Rx-Main.1.0.11226}/lib/SL4/System.Reactive.XML
  55. BIN packages/Rx-Main.1.0.11226/lib/SL4/System.Reactive.dll
  56. +5,431 −0 packages/Rx-Main.1.0.11226/lib/SL5/System.Reactive.XML
  57. BIN packages/Rx-Main.1.0.11226/lib/SL5/System.Reactive.dll
@@ -121,6 +121,10 @@
<summary>Sets the mole of <see cref="M:ReactiveTheMilk.RtmAuthorizer.GetFrob"/>
</summary>
</member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmAuthorizer.GetTokenString">
+ <summary>Sets the mole of <see cref="M:ReactiveTheMilk.RtmAuthorizer.GetToken(System.String)"/>
+ </summary>
+ </member>
<member name="P:ReactiveTheMilk.Moles.MRtmAuthorizer._GetFrobb__0String">
<summary>Sets the mole of <see cref="M:ReactiveTheMilk.RtmAuthorizer.&lt;GetFrob&gt;b__0(System.String)"/>
</summary>
@@ -129,6 +133,14 @@
<summary>Sets the mole of <see cref="M:ReactiveTheMilk.RtmAuthorizer.&lt;GetFrob&gt;b__1(System.Xml.Linq.XElement)"/>
</summary>
</member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmAuthorizer._GetTokenb__6String">
+ <summary>Sets the mole of <see cref="M:ReactiveTheMilk.RtmAuthorizer.&lt;GetToken&gt;b__6(System.String)"/>
+ </summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmAuthorizer._GetTokenb__7XElement">
+ <summary>Sets the mole of <see cref="M:ReactiveTheMilk.RtmAuthorizer.&lt;GetToken&gt;b__7(System.Xml.Linq.XElement)"/>
+ </summary>
+ </member>
<member name="T:ReactiveTheMilk.Moles.MRtmAuthorizer.AllInstances">
<summary>Define moles for all instances members</summary>
</member>
@@ -140,6 +152,10 @@
<summary>Sets the mole of <see cref="M:ReactiveTheMilk.RtmAuthorizer.GetFrob"/>
</summary>
</member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmAuthorizer.AllInstances.GetTokenString">
+ <summary>Sets the mole of <see cref="M:ReactiveTheMilk.RtmAuthorizer.GetToken(System.String)"/>
+ </summary>
+ </member>
<member name="T:ReactiveTheMilk.Moles.MRtmBase">
<summary>Mole type of <see cref="T:ReactiveTheMilk.RtmBase"/>
.</summary>
@@ -175,8 +191,8 @@
<summary>Sets the mole of <see cref="M:ReactiveTheMilk.RtmBase.GetRtmResponse(System.String)"/>
</summary>
</member>
- <member name="P:ReactiveTheMilk.Moles.MRtmBase.GetRtmResponseStringIEnumerableOfParameter">
- <summary>Sets the mole of <see cref="M:ReactiveTheMilk.RtmBase.GetRtmResponse(System.String,System.Collections.Generic.IEnumerable`1{ReactiveTheMilk.Parameter})"/>
+ <member name="P:ReactiveTheMilk.Moles.MRtmBase.GetRtmResponseStringParameterArray">
+ <summary>Sets the mole of <see cref="M:ReactiveTheMilk.RtmBase.GetRtmResponse(System.String,ReactiveTheMilk.Parameter[])"/>
</summary>
</member>
<member name="P:ReactiveTheMilk.Moles.MRtmBase._GetRtmResponseb__0WebResponse">
@@ -198,8 +214,8 @@
<summary>Sets the mole of <see cref="M:ReactiveTheMilk.RtmBase.GetRtmResponse(System.String)"/>
</summary>
</member>
- <member name="P:ReactiveTheMilk.Moles.MRtmBase.AllInstances.GetRtmResponseStringIEnumerableOfParameter">
- <summary>Sets the mole of <see cref="M:ReactiveTheMilk.RtmBase.GetRtmResponse(System.String,System.Collections.Generic.IEnumerable`1{ReactiveTheMilk.Parameter})"/>
+ <member name="P:ReactiveTheMilk.Moles.MRtmBase.AllInstances.GetRtmResponseStringParameterArray">
+ <summary>Sets the mole of <see cref="M:ReactiveTheMilk.RtmBase.GetRtmResponse(System.String,ReactiveTheMilk.Parameter[])"/>
</summary>
</member>
<member name="T:ReactiveTheMilk.Moles.MRtmException">
@@ -263,6 +279,154 @@
<summary>Sets the mole of <see cref="P:ReactiveTheMilk.RtmException.Msg"/>
</summary>
</member>
+ <member name="T:ReactiveTheMilk.Moles.MRtmToken">
+ <summary>Mole type of <see cref="T:ReactiveTheMilk.RtmToken"/>
+ .</summary>
+ </member>
+ <member name="M:ReactiveTheMilk.Moles.MRtmToken.#ctor">
+ <summary>Initializes a new mole</summary>
+ </member>
+ <member name="M:ReactiveTheMilk.Moles.MRtmToken.#ctor(ReactiveTheMilk.RtmToken)">
+ <summary>Initializes a new mole for the given instance</summary>
+ </member>
+ <member name="M:ReactiveTheMilk.Moles.MRtmToken.BehaveAsCurrent">
+ <summary>Assigns the &apos;Current&apos; behavior for all methods of the moled type</summary>
+ </member>
+ <member name="M:ReactiveTheMilk.Moles.MRtmToken.BehaveAsNotImplemented">
+ <summary>Assigns the &apos;NotImplemented&apos; behavior for all methods of the moled type</summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmToken.Behavior">
+ <summary>Assigns the behavior for all methods of the moled type</summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmToken.Constructor">
+ <summary>Sets the mole of <see cref="M:ReactiveTheMilk.RtmToken.#ctor"/>
+ </summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmToken.PermsGet">
+ <summary>Sets the mole of <see cref="P:ReactiveTheMilk.RtmToken.Perms"/>
+ </summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmToken.PermsSetString">
+ <summary>Sets the mole of <see cref="P:ReactiveTheMilk.RtmToken.Perms"/>
+ </summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmToken.TokenGet">
+ <summary>Sets the mole of <see cref="P:ReactiveTheMilk.RtmToken.Token"/>
+ </summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmToken.TokenSetString">
+ <summary>Sets the mole of <see cref="P:ReactiveTheMilk.RtmToken.Token"/>
+ </summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmToken.UserGet">
+ <summary>Sets the mole of <see cref="P:ReactiveTheMilk.RtmToken.User"/>
+ </summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmToken.UserSetRtmUser">
+ <summary>Sets the mole of <see cref="P:ReactiveTheMilk.RtmToken.User"/>
+ </summary>
+ </member>
+ <member name="T:ReactiveTheMilk.Moles.MRtmToken.AllInstances">
+ <summary>Define moles for all instances members</summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmToken.AllInstances.PermsGet">
+ <summary>Sets the mole of <see cref="P:ReactiveTheMilk.RtmToken.Perms"/>
+ </summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmToken.AllInstances.PermsSetString">
+ <summary>Sets the mole of <see cref="P:ReactiveTheMilk.RtmToken.Perms"/>
+ </summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmToken.AllInstances.TokenGet">
+ <summary>Sets the mole of <see cref="P:ReactiveTheMilk.RtmToken.Token"/>
+ </summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmToken.AllInstances.TokenSetString">
+ <summary>Sets the mole of <see cref="P:ReactiveTheMilk.RtmToken.Token"/>
+ </summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmToken.AllInstances.UserGet">
+ <summary>Sets the mole of <see cref="P:ReactiveTheMilk.RtmToken.User"/>
+ </summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmToken.AllInstances.UserSetRtmUser">
+ <summary>Sets the mole of <see cref="P:ReactiveTheMilk.RtmToken.User"/>
+ </summary>
+ </member>
+ <member name="T:ReactiveTheMilk.Moles.MRtmUser">
+ <summary>Mole type of <see cref="T:ReactiveTheMilk.RtmUser"/>
+ .</summary>
+ </member>
+ <member name="M:ReactiveTheMilk.Moles.MRtmUser.#ctor">
+ <summary>Initializes a new mole</summary>
+ </member>
+ <member name="M:ReactiveTheMilk.Moles.MRtmUser.#ctor(ReactiveTheMilk.RtmUser)">
+ <summary>Initializes a new mole for the given instance</summary>
+ </member>
+ <member name="M:ReactiveTheMilk.Moles.MRtmUser.BehaveAsCurrent">
+ <summary>Assigns the &apos;Current&apos; behavior for all methods of the moled type</summary>
+ </member>
+ <member name="M:ReactiveTheMilk.Moles.MRtmUser.BehaveAsNotImplemented">
+ <summary>Assigns the &apos;NotImplemented&apos; behavior for all methods of the moled type</summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmUser.Behavior">
+ <summary>Assigns the behavior for all methods of the moled type</summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmUser.Constructor">
+ <summary>Sets the mole of <see cref="M:ReactiveTheMilk.RtmUser.#ctor"/>
+ </summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmUser.FullnameGet">
+ <summary>Sets the mole of <see cref="P:ReactiveTheMilk.RtmUser.Fullname"/>
+ </summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmUser.FullnameSetString">
+ <summary>Sets the mole of <see cref="P:ReactiveTheMilk.RtmUser.Fullname"/>
+ </summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmUser.IdGet">
+ <summary>Sets the mole of <see cref="P:ReactiveTheMilk.RtmUser.Id"/>
+ </summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmUser.IdSetInt32">
+ <summary>Sets the mole of <see cref="P:ReactiveTheMilk.RtmUser.Id"/>
+ </summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmUser.UsernameGet">
+ <summary>Sets the mole of <see cref="P:ReactiveTheMilk.RtmUser.Username"/>
+ </summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmUser.UsernameSetString">
+ <summary>Sets the mole of <see cref="P:ReactiveTheMilk.RtmUser.Username"/>
+ </summary>
+ </member>
+ <member name="T:ReactiveTheMilk.Moles.MRtmUser.AllInstances">
+ <summary>Define moles for all instances members</summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmUser.AllInstances.FullnameGet">
+ <summary>Sets the mole of <see cref="P:ReactiveTheMilk.RtmUser.Fullname"/>
+ </summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmUser.AllInstances.FullnameSetString">
+ <summary>Sets the mole of <see cref="P:ReactiveTheMilk.RtmUser.Fullname"/>
+ </summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmUser.AllInstances.IdGet">
+ <summary>Sets the mole of <see cref="P:ReactiveTheMilk.RtmUser.Id"/>
+ </summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmUser.AllInstances.IdSetInt32">
+ <summary>Sets the mole of <see cref="P:ReactiveTheMilk.RtmUser.Id"/>
+ </summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmUser.AllInstances.UsernameGet">
+ <summary>Sets the mole of <see cref="P:ReactiveTheMilk.RtmUser.Username"/>
+ </summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.MRtmUser.AllInstances.UsernameSetString">
+ <summary>Sets the mole of <see cref="P:ReactiveTheMilk.RtmUser.Username"/>
+ </summary>
+ </member>
<member name="T:ReactiveTheMilk.Moles.MRtmUtils">
<summary>Mole type of <see cref="T:ReactiveTheMilk.RtmUtils"/>
.</summary>
@@ -355,5 +519,37 @@
<member name="P:ReactiveTheMilk.Moles.SRtmException.InstanceBehavior">
<summary>Gets or sets the instance behavior.</summary>
</member>
+ <member name="T:ReactiveTheMilk.Moles.SRtmToken">
+ <summary>Stub type of <see cref="T:ReactiveTheMilk.RtmToken"/>
+ .</summary>
+ </member>
+ <member name="M:ReactiveTheMilk.Moles.SRtmToken.#ctor">
+ <summary>Initializes a new instance</summary>
+ </member>
+ <member name="M:ReactiveTheMilk.Moles.SRtmToken.InitializeStub">
+ <summary>Initializes a new instance of type SRtmToken</summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.SRtmToken.CallBase">
+ <summary>Gets or sets a value that indicates if the base method should be called instead of the fallback behavior</summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.SRtmToken.InstanceBehavior">
+ <summary>Gets or sets the instance behavior.</summary>
+ </member>
+ <member name="T:ReactiveTheMilk.Moles.SRtmUser">
+ <summary>Stub type of <see cref="T:ReactiveTheMilk.RtmUser"/>
+ .</summary>
+ </member>
+ <member name="M:ReactiveTheMilk.Moles.SRtmUser.#ctor">
+ <summary>Initializes a new instance</summary>
+ </member>
+ <member name="M:ReactiveTheMilk.Moles.SRtmUser.InitializeStub">
+ <summary>Initializes a new instance of type SRtmUser</summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.SRtmUser.CallBase">
+ <summary>Gets or sets a value that indicates if the base method should be called instead of the fallback behavior</summary>
+ </member>
+ <member name="P:ReactiveTheMilk.Moles.SRtmUser.InstanceBehavior">
+ <summary>Gets or sets the instance behavior.</summary>
+ </member>
</members>
</doc>
@@ -38,8 +38,9 @@
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
- <Reference Include="ReactiveProperty.NET40, Version=0.3.1.0, Culture=neutral, processorArchitecture=MSIL">
- <HintPath>..\packages\ReactiveProperty.0.3.1.0\lib\NET40\ReactiveProperty.NET40.dll</HintPath>
+ <Reference Include="ReactiveProperty.NET40, Version=0.3.2.0, Culture=neutral, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\packages\ReactiveProperty.0.3.2.0\lib\NET40\ReactiveProperty.NET40.dll</HintPath>
</Reference>
<Reference Include="ReactiveProperty.NET40.Moles, Version=0.3.1.0, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="ReactiveTheMilk.Moles, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
@@ -53,11 +54,11 @@
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Moles, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0ae41878053f6703, processorArchitecture=MSIL" />
<Reference Include="System.Reactive, Version=1.0.10621.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <HintPath>..\packages\Rx-Main.1.0.10621\lib\Net4\System.Reactive.dll</HintPath>
+ <HintPath>..\packages\Rx-Main.1.0.11226\lib\Net4\System.Reactive.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <HintPath>..\packages\ReactiveProperty.0.3.1.0\lib\NET40\System.Windows.Interactivity.dll</HintPath>
+ <HintPath>..\packages\ReactiveProperty.0.3.2.0\lib\NET40\System.Windows.Interactivity.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
@@ -12,38 +12,38 @@
namespace ReactiveTheMilk
{
- [TestClass]
- public class RtmAuthorizerTest
- {
- private const string ApiKey = "api_key";
- private const string Secret = "signature";
- private const string Frob = "frob";
+ [TestClass]
+ public class RtmAuthorizerTest
+ {
+ private const string ApiKey = "api_key";
+ private const string Secret = "signature";
+ private const string Frob = "frob";
private RtmAuthorizer rtm;
- [TestInitialize]
- public void SetUp()
- {
- rtm = new SRtmAuthorizer(ApiKey, Secret);
- }
+ [TestInitialize]
+ public void SetUp()
+ {
+ rtm = new SRtmAuthorizer(ApiKey, Secret);
+ }
- [TestMethod]
- [HostType("Moles")]
- public void TestGetFrob()
- {
- var rspRaw = @"<rsp stat=""ok""><frob>frob</frob></rsp>";
+ [TestMethod]
+ [HostType("Moles")]
+ public void TestGetFrob()
+ {
+ var rspRaw = @"<rsp stat=""ok""><frob>frob</frob></rsp>";
- MRtmBase.AllInstances.GetRtmResponseString = (a, method) =>
- {
- method.Is("rtm.auth.getFrob");
- return Observable.Return(rspRaw);
- };
+ new MRtmBase(rtm).GetRtmResponseString = (method) =>
+ {
+ method.Is("rtm.auth.getFrob");
+ return Observable.Return(rspRaw);
+ };
- IObservable<string> result = rtm.GetFrob();
- string frob = result.First();
+ IObservable<string> result = rtm.GetFrob();
+ string frob = result.First();
- frob.Is("frob");
- }
+ frob.Is("frob");
+ }
[TestMethod]
[HostType("Moles")]
@@ -80,5 +80,41 @@ public void TestGetAuthenticationUrl()
url.Is("http://www.rememberthemilk.com/services/auth/?api_key=api_key&perms=delete&frob=frob&api_sig=signature");
}
- }
+ [TestMethod]
+ [HostType("Moles")]
+ public void TestGetToken()
+ {
+ var rspRaw = @"
+ <rsp stat=""ok"">
+ <auth>
+ <token>410c57262293e9d937ee5be75eb7b0128fd61b61</token>
+ <perms>delete</perms>
+ <user id=""1"" username=""bob"" fullname=""Bob T. Monkey"" />
+ </auth>
+ </rsp>
+ ";
+
+ new MRtmBase(rtm).GetRtmResponseStringParameterArray = (method, parameters) =>
+ {
+ method.Is("rtm.auth.getToken");
+ var param = parameters.First();
+ param.Key.Is("frob");
+ param.Value.Is("frobvalue");
+
+ return Observable.Return(rspRaw);
+ };
+
+ var frob = "frobvalue";
+ IObservable<RtmToken> result = rtm.GetToken(frob);
+ RtmToken token = result.First();
+
+ token.Token.Is("410c57262293e9d937ee5be75eb7b0128fd61b61");
+ token.Perms.Is("delete");
+ RtmUser user = token.User;
+ user.Id.Is(1);
+ user.Username.Is("bob");
+ user.Fullname.Is("Bob T. Monkey");
+ }
+
+ }
}
Oops, something went wrong.

0 comments on commit 61a4caa

Please sign in to comment.