public void InMemorySearch_KeywordWithKnownResults_SearchResultsPresent(WireDataFormat format)
 {
     var client = TestContext.CreateClientNoCredentials(format);
     var searchClient = new SearchApi(client.HttpChannel);
     
     var items = searchClient.InMemorySearch(null, "James", "Morrison", null);
     Assert.IsTrue(items.Results.Any());
 }
        public void EventSearch_KeywordWithKnownResults_SearchResultsPresent(WireDataFormat format)
        {
            var client = TestContext.CreateClientNoCredentials(format);
            var searchClient = new SearchApi(client.HttpChannel);

            var items = searchClient.EventSearch("Test");
            Assert.IsTrue(items.Results.Any());
        }
        public void InMemorySearch_KeywordWithOnlyLastName_ReturnsError_NotingFirstNameIsMandatory(WireDataFormat format)
        {
            var client = TestContext.CreateClientNoCredentials(format);
            var searchClient = new SearchApi(client.HttpChannel);

            var exception = Assert.Throws<ErrorResponseException>(() => searchClient.InMemorySearch(null, null, "Morrison", null));

            Assert.That(exception.Errors.Count, Is.EqualTo(1));
            Assert.That(exception.Errors[0].Id, Is.EqualTo("InvalidFirstName"));
            Assert.That(exception.Errors[0].Description, Is.EqualTo("The first name of the person you're remembering cannot be empty."));
        }
        public void CharitySearch_KeywordWithKnownResults_SearchResultsPresent(WireDataFormat format)
        {
            //arrange
            var client = TestContext.CreateClientNoCredentials(format);
            var searchClient = new SearchApi(client.HttpChannel);

            //act
            var items = searchClient.CharitySearch("cancer");

            //assert
            Assert.IsTrue(items.Results.Any());
        }
        public void FundraiserSearch_KeywordWithKnownResult_SearchResultPresent(WireDataFormat format)
        {
            //arrange
            var client = TestContext.CreateClientNoCredentials(format);
            var searchResources = new SearchApi(client.HttpChannel);

            //act
            var result = searchResources.FundraiserSearch("pawel");

            //assert
            Assert.IsTrue(result.SearchResults.Any());
        }