public void Can_Update_Template()
        {
            // Setup
            var          apiKey       = ConfigurationManager.AppSettings["APIKey"];
            var          templateName = ConfigurationManager.AppSettings["TemplateExample"];
            const string original     = "<span mc:edit=\"model1\"></span>";
            const string modified     = "<span mc:edit=\"model2\"></span>";

            // Exercise
            var api    = new MandrillApi(apiKey);
            var result = api.UpdateTemplate(templateName,
                                            "*****@*****.**",
                                            "Test",
                                            "Template test",
                                            modified,
                                            "*|model1|*",
                                            true,
                                            null);
            var result2 = api.UpdateTemplate(templateName,
                                             "*****@*****.**",
                                             "Test",
                                             "Template test",
                                             original,
                                             "*|model1|*",
                                             true,
                                             null);

            // Verify
            Assert.AreEqual(modified, result.code);
            Assert.AreEqual(original, result2.code);
        }
示例#2
0
        public async Task Can_Update_Template()
        {
            // Setup
            string       apiKey       = ConfigurationManager.AppSettings["APIKey"];
            string       templateName = ConfigurationManager.AppSettings["TemplateExample"];
            const string original     = "<span mc:edit=\"model1\"></span>";
            const string modified     = "<span mc:edit=\"model2\"></span>";

            // Exercise
            var          api    = new MandrillApi(apiKey);
            TemplateInfo result = await api.UpdateTemplate(
                new UpdateTemplateRequest(templateName)
            {
                Code = modified
            });

            TemplateInfo result2 = await api.UpdateTemplate(
                new UpdateTemplateRequest(templateName)
            {
                Code = original
            });

            // Verify
            Assert.AreEqual(modified, result.Code);
            Assert.AreEqual(original, result2.Code);
        }
    public async Task Can_Update_Template()
    {
      // Setup
      string apiKey = ConfigurationManager.AppSettings["APIKey"];
      string templateName = ConfigurationManager.AppSettings["TemplateExample"];
      const string original = "<span mc:edit=\"model1\"></span>";
      const string modified = "<span mc:edit=\"model2\"></span>";

      // Exercise
      var api = new MandrillApi(apiKey);
      TemplateInfo result = await api.UpdateTemplate(
        new UpdateTemplateRequest(templateName)
        {
          Code = modified
        });
      TemplateInfo result2 = await api.UpdateTemplate(
        new UpdateTemplateRequest(templateName)
        {
          Code = original
        });

      // Verify
      Assert.AreEqual(modified, result.Code);
      Assert.AreEqual(original, result2.Code);
    }
        public void Can_Update_Template()
        {
            // Setup
            var apiKey = ConfigurationManager.AppSettings["APIKey"];
            var templateName = ConfigurationManager.AppSettings["TemplateExample"];
            const string original = "<span mc:edit=\"model1\"></span>";
            const string modified = "<span mc:edit=\"model2\"></span>";

            // Exercise
            var api = new MandrillApi(apiKey);
            var result = api.UpdateTemplate(templateName,
                "*****@*****.**",
                "Test",
                "Template test",
                modified,
                "*|model1|*",
                true,
                null);
            var result2 = api.UpdateTemplate(templateName,
                "*****@*****.**",
                "Test",
                "Template test",
                original,
                "*|model1|*",
                true,
                null);

            // Verify
            Assert.AreEqual(modified, result.code);
            Assert.AreEqual(original, result2.code);
        }