/// <summary> /// Fixes the description placeholder. /// </summary> /// <remarks> /// This method fixes the description placeholder if necessary. /// </remarks> /// <param name="value"> /// The help preface attribute to be fixed. /// </param> /// <returns> /// The fixed help preface attribute. /// </returns> private HelpPrefaceAttribute FixupPreface(HelpPrefaceAttribute value) { if (value.IsContent) { if (value.Content.Contains(Placeholders.Description)) { try { AssemblyDescriptionAttribute description = Assembly.GetEntryAssembly().GetCustomAttributes() .Where(x => x is AssemblyDescriptionAttribute).FirstOrDefault() as AssemblyDescriptionAttribute; if (description != null && !String.IsNullOrWhiteSpace(description.Description)) { value.Content = value.Content.Replace(Placeholders.Description, description.Description); } } catch (Exception exception) { Debug.WriteLine(exception); } } } return(value); }
public void HelpPreface_SetProperty_ResultIsEmptyContent(String actual) { HelpPrefaceAttribute attribute = new HelpPrefaceAttribute(); attribute.Content = actual; Assert.IsEmpty(attribute.Content); }
public void HelpPreface_SetProperty_TrimmedContent(String actual) { HelpPrefaceAttribute attribute = new HelpPrefaceAttribute(); attribute.Content = actual; Assert.AreEqual(attribute.Content, "Hello World"); }
public void HelpPreface_Construction_ResultIsEmptyContent(String actual) { HelpPrefaceAttribute attribute = new HelpPrefaceAttribute(actual); Assert.IsEmpty(attribute.Content); }