public async Task Should_List_Rejects() { // Setup string apiKey = ConfigurationManager.AppSettings["APIKey"]; string reject1 = ConfigurationManager.AppSettings["RejectAdd"] + Guid.NewGuid(); string reject2 = ConfigurationManager.AppSettings["RejectAdd"] + Guid.NewGuid(); // Exercise var api = new MandrillApi(apiKey); //Verify await api.AddReject(new AddRejectRequest(reject1)); await api.AddReject(new AddRejectRequest(reject2)); List <RejectInfo> response = await api.ListRejects(new ListRejectsRequest()); // Verify Assert.Contains(reject1, response.Select(r => r.Email).ToList()); Assert.Contains(reject2, response.Select(r => r.Email).ToList()); // Cleanup await api.DeleteReject(new DeleteRejectRequest(reject1)); await api.DeleteReject(new DeleteRejectRequest(reject2)); }
public void List_Rejects_Works() { // Setup var apiKey = ConfigurationManager.AppSettings["APIKey"]; // Exercise var api = new MandrillApi(apiKey); // Verify var rejects = api.ListRejects(); //TODO: test this....works with my api key :) }
public void List_Rejects_Throws_Exception_On_Invalid_ApiKey() { // Setup var apiKey = " "; // Exercise var api = new MandrillApi(apiKey); // Verify var ex = Assert.Throws<MandrillException>(() => api.ListRejects()); Assert.That(ex.Error.name, Is.EqualTo("Invalid_Key")); }
public void List_Rejects_Throws_Exception_On_Invalid_ApiKey() { // Setup var apiKey = " "; // Exercise var api = new MandrillApi(apiKey); // Verify var ex = Assert.Throws <MandrillException>(() => api.ListRejects()); Assert.That(ex.Error.name, Is.EqualTo("Invalid_Key")); }
public async Task Should_List_Rejects() { // Setup string apiKey = ConfigurationManager.AppSettings["APIKey"]; string reject1 = ConfigurationManager.AppSettings["RejectAdd"] + Guid.NewGuid(); string reject2 = ConfigurationManager.AppSettings["RejectAdd"] + Guid.NewGuid(); // Exercise var api = new MandrillApi(apiKey); //Verify await api.AddReject(new AddRejectRequest(reject1)); await api.AddReject(new AddRejectRequest(reject2)); List<RejectInfo> response = await api.ListRejects(new ListRejectsRequest()); // Verify Assert.Contains(reject1, response.Select(r => r.Email).ToList()); Assert.Contains(reject2, response.Select(r => r.Email).ToList()); // Cleanup await api.DeleteReject(new DeleteRejectRequest(reject1)); await api.DeleteReject(new DeleteRejectRequest(reject2)); }
public void List_Rejects_Works() { // Setup var apiKey = ConfigurationManager.AppSettings["APIKey"]; // Exercise var api = new MandrillApi(apiKey); // Verify var rejects = api.ListRejects(); //TODO: test this....works with my api key :) }