Skip to content

Instantly share code, notes, and snippets.

@danielwertheim
Created October 29, 2013 19:43
Show Gist options
  • Save danielwertheim/7221261 to your computer and use it in GitHub Desktop.
Save danielwertheim/7221261 to your computer and use it in GitHub Desktop.
[Fact]
public void Can_search_on_default_index()
{
var searchRequest = new SearchIndexRequest(CloudantTestData.Views.Views101AnimalsSearchIndexId)
.Configure(q => q.Expression("kookaburra"));
var response = SUT.SearchAsync(searchRequest).Result;
response.Should().BeSuccessfulGet(numOfRows: 1);
response.Bookmark.Should().NotBeNullOrEmpty();
response.Rows[0].Id.Should().Be("kookaburra");
response.Rows[0].Order.Should().BeEquivalentTo(new[] {1.4054651260375977, 0});
response.Rows[0].Fields.Count.Should().Be(4);
response.Rows[0].Fields["diet"].Should().Be("carnivore");
response.Rows[0].Fields["minLength"].Should().Be(0.28);
response.Rows[0].Fields["class"].Should().Be("bird");
response.Rows[0].Fields["latinName"].Should().Be("Dacelo novaeguineae");
response.Rows[0].IncludedDoc.Should().BeNull();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment