Exemple #1
0
        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_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));
    }