예제 #1
0
 public void Update(WebSite details)
 {
     if (!string.IsNullOrEmpty(details.DomainName))
         DomainName = details.DomainName;
     if (!string.IsNullOrEmpty(details.Description))
         Description = details.Description;
     LastUpdated = DateTime.UtcNow;
     Status = details.Status;
     if (!string.IsNullOrEmpty(details.MailDomainName))
         MailDomainName = details.MailDomainName;
     foreach (var key in details.Details.Keys)
         if (Details.ContainsKey(key))
             Details[key] = details.Details[key];
         else
             Details.Add(key, details.Details[key]);
 }
 private static WebSite BuildTestSite(long siteId, string name)
 {
     var s = new WebSite
     {
         SiteId = siteId,
         DomainName = name + ".dev.bigblackspider.com",
         Description = $"Unit test website for '{name}'.",
         MailDomainName = name + ".mail.bigblackspider.com"
     };
     s.Details.Add("$SHORT-DESCRIPTION$", "Test web site.");
     s.Details.Add("$MAIN-HEADING$", $"{name} Unit Test Web Site");
     s.Details.Add("$MAIN-TEXT$", $"This is a unit test website for '<b>{name}</b>,'.");
     s.Details.Add("$ABOUT-HEADING$", $"All About {name}'");
     s.Details.Add("$ABOUT-TEXT$",
         $"Some text that describes the about section for domain '<b><i>{s.DomainName}</i></b>'.");
     return s;
 }