Exemplo n.º 1
0
        public void TestBase64Utility()
        {
            string helloWorld             = "Hello World!";
            string helloWorldBase64String = Base64Utility.Serialize(helloWorld);

            Assert.AreEqual("Hello World!", Base64Utility.Deserialize(helloWorldBase64String));
        }
Exemplo n.º 2
0
 public void SendOpsNotification(string name, string content, IList <string> toAddresses = null)
 {
     try
     {
         string subject = String.Format(this.NotificationTemplateConfig.SubjectWapper, name);
         string body    = String.Format(Base64Utility.Deserialize(this.NotificationTemplateConfig.BodyWapper), content);
         this.SendNotification(this.TemplateConfig.FromAddress, this.TemplateConfig.FromDisplayName, toAddresses != null ? toAddresses : this.TemplateConfig.ToAddresses, this.TemplateConfig.CCAddresses, this.TemplateConfig.BCCAddresses,
                               this.TemplateConfig.ReplyToAddresses, this.TemplateConfig.Headers != null ? this.TemplateConfig.Headers.Select(h => new Header {
             Name = h.Name, Value = h.Value
         }).ToList() : null, subject, body, true);
     }
     catch (Exception exception)
     {
         this.Logger.LogError(exception, exception.Message);
     }
 }