コード例 #1
0
 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());
 }
コード例 #2
0
        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."));
        }