private void VerifyProperty(List <AlertProperty> properties, string name, AlertPresentationSection displayCategory, string value, string infoBalloon) { var property = properties.SingleOrDefault(p => p.Name == name); Assert.IsNotNull(property, $"Property {name} not found"); Assert.AreEqual(displayCategory.ToString(), property.DisplayCategory.ToString()); Assert.AreEqual(value, property.Value); Assert.AreEqual(infoBalloon, property.InfoBalloon); }
/// <summary> /// Initializes a new instance of the <see cref="AlertPresentationPropertyAttribute"/> class. /// </summary> /// <param name="section">The section in which the property will be presented.</param> /// <param name="title">The title to use when presenting the property's value.</param> /// <exception cref="ArgumentNullException"><paramref name="title"/> is null or contains only white-spaces.</exception> public AlertPresentationPropertyAttribute(AlertPresentationSection section, string title) { if (string.IsNullOrWhiteSpace(title)) { throw new ArgumentNullException(nameof(title), "A property cannot be presented without a title"); } this.Section = section; this.Title = title; }
/// <summary> /// Gets the display category enum value from the presentation section enum value /// </summary> /// <param name="presentationSection">The property presentation section</param> /// <returns>The display category that coralline with the presentation section</returns> private static AlertPropertyDisplayCategory GetDisplayCategoryFromPresentationSection(AlertPresentationSection presentationSection) { switch (presentationSection) { case AlertPresentationSection.AdditionalQuery: return(AlertPropertyDisplayCategory.AdditionalQuery); case AlertPresentationSection.Analysis: return(AlertPropertyDisplayCategory.Analysis); case AlertPresentationSection.Chart: return(AlertPropertyDisplayCategory.Chart); case AlertPresentationSection.Property: default: return(AlertPropertyDisplayCategory.Property); } }