public async Task Should_Return_Messages_Matching_Search_Criteria() { // Setup string apiKey = ConfigurationManager.AppSettings["APIKey"]; string subjSKey = ConfigurationManager.AppSettings["UniqueExistingEmailSubject"]; // Exercise var api = new MandrillApi(apiKey); var search = new SearchRequest { Query = String.Format(@"subject:{0}", subjSKey), }; List <SearchResult> result = await api.Search(search); //Verify 2 Assert.AreEqual(1, result.Count); Assert.AreEqual(subjSKey, result[0].Subject); }
public async Task Should_Return_Messages_Matching_Search_Criteria() { // Setup string apiKey = ConfigurationManager.AppSettings["APIKey"]; string subjSKey = ConfigurationManager.AppSettings["UniqueExistingEmailSubject"]; // Exercise var api = new MandrillApi(apiKey); var search = new SearchRequest { Query = String.Format(@"subject:{0}", subjSKey), }; List<SearchResult> result = await api.Search(search); //Verify 2 Assert.AreEqual(1, result.Count); Assert.AreEqual(subjSKey, result[0].Subject); }
public void Can_Search_Message() { // Setup var apiKey = ConfigurationManager.AppSettings["APIKey"]; string toEmail = ConfigurationManager.AppSettings["ValidToEmail"]; string fromEmail = ConfigurationManager.AppSettings["FromEMail"]; string subjSKey = ConfigurationManager.AppSettings["UniqueExistingEmailSubject"]; // Exercise var api = new MandrillApi(apiKey); var search = new Search { query = String.Format(@"subject:{0}", subjSKey), limit = "10" }; var result = api.Search(search); //Verify 2 Assert.AreEqual(1, result.Count); Assert.AreEqual(subjSKey, result[0].subject); }