From 3fca5a059bdb7bbce3d4c134fac203d5eff95c15 Mon Sep 17 00:00:00 2001 From: Tobias Klika Date: Mon, 2 Dec 2013 22:51:24 +0100 Subject: [PATCH] update tests --- PocketSharp.Tests/StressTests.cs | 2 +- PocketSharp/Components/Account.cs | 6 +++--- PocketSharp/Components/Get.cs | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/PocketSharp.Tests/StressTests.cs b/PocketSharp.Tests/StressTests.cs index c465331..845cf22 100644 --- a/PocketSharp.Tests/StressTests.cs +++ b/PocketSharp.Tests/StressTests.cs @@ -68,7 +68,7 @@ namespace PocketSharp.Tests List items = await client.Get(search: "google"); Assert.True(items.Count > 0); - Assert.True(items[0].FullTitle.ToLower().Contains("google")); + Assert.True(items[0].Title.ToLower().Contains("google") || items[0].Uri.ToString().ToLower().Contains("google")); } [Fact] diff --git a/PocketSharp/Components/Account.cs b/PocketSharp/Components/Account.cs index a382a72..487014b 100644 --- a/PocketSharp/Components/Account.cs +++ b/PocketSharp/Components/Account.cs @@ -50,13 +50,13 @@ namespace PocketSharp public Uri GenerateAuthenticationUri(string requestCode = null) { // check if request code is available - if(RequestCode == null && requestCode == null) + if (RequestCode == null && requestCode == null) { throw new NullReferenceException("Call GetRequestCode() first to receive a request_code"); } // override property with given param if available - if(requestCode != null) + if (requestCode != null) { RequestCode = requestCode; } @@ -122,7 +122,7 @@ namespace PocketSharp { if (username == null || email == null || password == null) { - throw new ArgumentNullException("All parameters are required"); + throw new ArgumentNullException("All parameters are required"); } Match matchEmail = Regex.Match(email, @"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,10}))$"); diff --git a/PocketSharp/Components/Get.cs b/PocketSharp/Components/Get.cs index 3206dca..f250e2a 100644 --- a/PocketSharp/Components/Get.cs +++ b/PocketSharp/Components/Get.cs @@ -1,9 +1,9 @@ using PocketSharp.Models; using System; using System.Collections.Generic; -using System.Threading.Tasks; using System.Linq; using System.Threading; +using System.Threading.Tasks; namespace PocketSharp { @@ -76,9 +76,9 @@ namespace PocketSharp { List items = await Get( cancellationToken: cancellationToken, - state: State.all + state: State.all ); - + return items.SingleOrDefault(item => item.ID == itemID); }