Exemplo n.º 1
0
        /// <summary>
        /// A representation of this file to deploy
        /// </summary>
        /// <returns></returns>
        public virtual string ToStringDescription(string sourceDir = null)
        {
            var sb = new StringBuilder();

            sb.Append("<div style='padding-left: 10px'>");
            if (IsOk)
            {
                sb.Append("<img height='15px' src='" + DeployImage + "'>");
            }
            else
            {
                sb.Append("<img height='15px' src='Error'>Transfer failed for ");
            }
            sb.Append("<span style='padding-right: 8px;'>(" + DeployType);
            if (RuleReference != null)
            {
                sb.Append(" " + RuleReference.ToStringDescription());
            }
            sb.Append(")</span>");
            sb.Append(DeployText(sourceDir));
            if (!IsOk)
            {
                sb.Append("<br>");
                sb.Append(DeployError);
            }
            sb.Append("</div>");
            return(sb.ToString());
        }
        public void RuleConflictInfo_Ctor_ArgChecks()
        {
            // Arrange
            IEnumerable <RuleReference>             ruleRefs = null;
            IDictionary <RuleReference, RuleAction> rulesMap = null;

            IEnumerable <RuleReference>             ruleRefsNull = new RuleReference[0];
            IDictionary <RuleReference, RuleAction> rulesMapNull = new Dictionary <RuleReference, RuleAction>();

            // Act + Assert
            Exceptions.Expect <ArgumentNullException>(() => new RuleConflictInfo(ruleRefsNull, rulesMap));
            Exceptions.Expect <ArgumentNullException>(() => new RuleConflictInfo(ruleRefs, rulesMapNull));
        }
        public void RuleConflictInfo_Ctor_ArgChecks()
        {
            // Setup
            IEnumerable<RuleReference> ruleRefs = null;
            IDictionary<RuleReference, RuleAction> rulesMap = null;

            IEnumerable<RuleReference> ruleRefsNull = new RuleReference[0];
            IDictionary<RuleReference, RuleAction> rulesMapNull = new Dictionary<RuleReference, RuleAction>();

            // Act + Verify
            Exceptions.Expect<ArgumentNullException>(() => new RuleConflictInfo(ruleRefsNull, rulesMap));
            Exceptions.Expect<ArgumentNullException>(() => new RuleConflictInfo(ruleRefs, rulesMapNull));
        }
Exemplo n.º 4
0
 private bool MatchNameOrAlias(RuleReference rule, string name)
 {
     return(rule.Category.Equals(name, System.StringComparison.OrdinalIgnoreCase) || rule.Aliases?.Any(a => a.Equals(name, System.StringComparison.OrdinalIgnoreCase)) == true);
 }