public async Task Should_Get_Template_Time_Series() { // Setup string apiKey = ConfigurationManager.AppSettings["APIKey"]; string templateName = Guid.NewGuid().ToString(); const string code = "Foobar"; // Exercise var api = new MandrillApi(apiKey); await api.AddTemplate(new AddTemplateRequest(templateName) { FromName = "*****@*****.**", Code = code, Text = code, Publish = true }); List <TemplateTimeSeries> result = await api.TemplateTimeSeries(new TemplateTimeSeriesRequest(templateName)); // Verify Assert.IsNotNull(result); //Time series do not exist for brand new templates. No other asserts possible. // Cleanup await api.DeleteTemplate(new DeleteTemplateRequest(templateName)); }
public async Task Should_Return_Correct_Count() { // Setup string apiKey = ConfigurationManager.AppSettings["APIKey"]; string templateName = Guid.NewGuid().ToString(); const string code = "Foobar"; // Exercise var api = new MandrillApi(apiKey); await api.AddTemplate(new AddTemplateRequest(templateName) { FromName = "*****@*****.**", Code = code, Text = code, Publish = true }); List<TemplateInfo> result = await api.ListTemplates(new ListTemplatesRequest()); Assert.True(result.Any(r => r.Name == templateName)); // Cleanup await api.DeleteTemplate(new DeleteTemplateRequest(templateName)); }
public async Task Should_Get_Template_Info() { // Setup string apiKey = ConfigurationManager.AppSettings["APIKey"]; string templateName = Guid.NewGuid().ToString(); const string code = "Foobar"; // Exercise var api = new MandrillApi(apiKey); await api.AddTemplate(new AddTemplateRequest(templateName) { FromName = "*****@*****.**", Code = code, Text = code, Publish = true }); TemplateInfo result = await api.TemplateInfo(new TemplateInfoRequest(templateName)); // Verify Assert.AreEqual(templateName, result.Name); Assert.AreEqual(code, result.Code); // Cleanup await api.DeleteTemplate(new DeleteTemplateRequest(templateName)); }
public async Task Should_Return_Correct_Count() { // Setup string apiKey = ConfigurationManager.AppSettings["APIKey"]; string templateName = Guid.NewGuid().ToString(); const string code = "Foobar"; // Exercise var api = new MandrillApi(apiKey); await api.AddTemplate(new AddTemplateRequest(templateName) { FromName = "*****@*****.**", Code = code, Text = code, Publish = true }); List <TemplateInfo> result = await api.ListTemplates(new ListTemplatesRequest()); Assert.True(result.Any(r => r.Name == templateName)); // Cleanup await api.DeleteTemplate(new DeleteTemplateRequest(templateName)); }
public async Task Should_Get_Template_Time_Series() { // Setup string apiKey = ConfigurationManager.AppSettings["APIKey"]; string templateName = Guid.NewGuid().ToString(); const string code = "Foobar"; // Exercise var api = new MandrillApi(apiKey); await api.AddTemplate(new AddTemplateRequest(templateName) { FromName = "*****@*****.**", Code = code, Text = code, Publish = true }); List<TemplateTimeSeries> result = await api.TemplateTimeSeries(new TemplateTimeSeriesRequest(templateName)); // Verify Assert.IsNotNull(result); //Time series do not exist for brand new templates. No other asserts possible. // Cleanup await api.DeleteTemplate(new DeleteTemplateRequest(templateName)); }
public void Can_Create_And_Delete_Template() { // Setup var apiKey = ConfigurationManager.AppSettings["APIKey"]; var templateName = ConfigurationManager.AppSettings["TemplateExample"] + "_temp"; const string code = "Foobar"; // Exercise var api = new MandrillApi(apiKey); var result = api.AddTemplate(templateName, "*****@*****.**", "Test", "Template test", code, code, true); var result2 = api.DeleteTemplate(templateName); // Verify Assert.AreEqual(code, result.code); Assert.AreEqual(code, result2.code); }
public async Task Should_Create_And_Delete_Template() { // Setup string apiKey = ConfigurationManager.AppSettings["APIKey"]; string templateName = ConfigurationManager.AppSettings["TemplateExample"] + "_temp"; const string code = "Foobar"; // Exercise var api = new MandrillApi(apiKey); TemplateInfo result = await api.AddTemplate(new AddTemplateRequest(templateName) { FromName = "*****@*****.**", Code = code, Text = code, Publish = true }); TemplateInfo result2 = await api.DeleteTemplate(new DeleteTemplateRequest(templateName)); // Verify Assert.AreEqual(code, result.Code); Assert.AreEqual(code, result2.Code); }