Skip to content

Commit

Permalink
adding test for result limit
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith committed Dec 15, 2013
1 parent bf69fb5 commit 2111bf5
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
32 changes: 32 additions & 0 deletions YelpSharpTests/GeneralTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,38 @@ public void MultipleCategories()
var results = yelp.Search(searchOptions).Result;
Assert.IsTrue(results.businesses.Count > 0);
}

/// <summary>
/// Verify the limit parameter works as expected.
/// </summary>
[TestMethod]
public void LimitTest()
{
var y = new Yelp(Config.Options);
var searchOptions = new SearchOptions()
{
GeneralOptions = new GeneralOptions()
{
term = "coffee",
limit = 15,
},
LocationOptions = new LocationOptions()
{
location = "seattle, wa"
}
};
var results = y.Search(searchOptions).Result;
if (results.error != null)
{
Assert.Fail(results.error.text);
}
if (results.businesses.Count != 15)
{
Assert.Fail(string.Format("Limit test returned {0} results instead of 15", results.businesses.Count));
}

Console.WriteLine(results);
}

}
}
1 change: 0 additions & 1 deletion YelpSharpTests/LocationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ public void LocationByBounds()
var yelp = new Yelp(Config.Options);
var searchOptions = new YelpSharp.Data.Options.SearchOptions()
{
//GeneralOptions = new GeneralOptions() { radius_filter = 5 },
LocationOptions = new CoordinateOptions()
{
latitude = 37.788022,
Expand Down

0 comments on commit 2111bf5

Please sign in to comment.