コード例 #1
0
        public async Task Render_Template_Returns_Correct_Content()
        {
            // Setup
            string apiKey       = ConfigurationManager.AppSettings["APIKey"];
            string templateName = ConfigurationManager.AppSettings["TemplateExample"];

            // Exercise
            var api             = new MandrillApi(apiKey);
            var templateContent = new TemplateContent
            {
                Content = "Test",
                Name    = "model1"
            };
            RenderedTemplate result = await api.Render(new RenderTemplateRequest(templateName)
            {
                TemplateContent = new List <TemplateContent> {
                    templateContent
                }
            });

            string expected = "<span>Test</span>";

            // Verify
            Assert.AreEqual(expected, result.Html);
        }
コード例 #2
0
        public void Render_Template_Returns_Correct_Content()
        {
            // Setup
            var apiKey = ConfigurationManager.AppSettings["APIKey"];
            var templateName = ConfigurationManager.AppSettings["TemplateExample"];

            // Exercise
            var api = new MandrillApi(apiKey);
            var templateContent = new TemplateContent
                                      {
                                          content = "Test",
                                          name = "model1"
                                      };
            var result = api.Render(templateName, new List<TemplateContent>{templateContent}, null);

            string expected = "<!DOCTYPE html>\n<span>Test</span>";

            // Verify
            Assert.AreEqual(expected, result.html);
        }
コード例 #3
0
      public void Render_Template_Returns_Correct_Content()
      {
          // Setup
          var apiKey       = ConfigurationManager.AppSettings["APIKey"];
          var templateName = ConfigurationManager.AppSettings["TemplateExample"];

          // Exercise
          var api             = new MandrillApi(apiKey);
          var templateContent = new TemplateContent
          {
              content = "Test",
              name    = "model1"
          };
          var result = api.Render(templateName, new List <TemplateContent> {
                templateContent
            }, null);

          string expected = "<!DOCTYPE html>\n<span>Test</span>";

          // Verify
          Assert.AreEqual(expected, result.html);
      }
コード例 #4
0
    public async Task Render_Template_Returns_Correct_Content()
    {
      // Setup
      string apiKey = ConfigurationManager.AppSettings["APIKey"];
      string templateName = ConfigurationManager.AppSettings["TemplateExample"];

      // Exercise
      var api = new MandrillApi(apiKey);
      var templateContent = new TemplateContent
      {
        Content = "Test",
        Name = "model1"
      };
      RenderedTemplate result = await api.Render(new RenderTemplateRequest(templateName)
      {
        TemplateContent = new List<TemplateContent> {templateContent}
      });

      string expected = "<span>Test</span>";

      // Verify
      Assert.AreEqual(expected, result.Html);
    }