using System; namespace LightWebTestFramework.Rules { [Serializable] public class RuleResult { private bool m_success = true; private string m_message; private string m_ruleType; private PropertyCollection m_ruleProperties; private string m_ruleName; private Exception m_exception; public bool Success { get { return this.m_exception == null && this.m_success; } internal set { this.m_success = value; } } public string Message { get { if (this.m_exception != null) { return this.m_exception.Message; } if (!string.IsNullOrEmpty(this.m_message)) { return this.m_message; } if (this.IsConditionalRule) { if (!this.m_success) { return Resources.ConditionNotMet; } return Resources.ConditionMet; } else { if (!this.m_success) { return Resources.Failed; } return Resources.Passed; } } internal set { this.m_message = value; } } public string RuleType { get { return this.m_ruleType; } internal set { this.m_ruleType = value; } } public PropertyCollection RuleProperties { get { return this.m_ruleProperties; } internal set { this.m_ruleProperties = value; } } public string Name { get { return this.m_ruleName; } internal set { this.m_ruleName = value; } } public Exception Exception { get { return this.m_exception; } internal set { this.m_exception = value; } } internal bool IsConditionalRule { get { return string.Equals(this.m_ruleType, Resources.ConditionalRuleType, StringComparison.Ordinal); } } internal RuleResult() { } internal RuleResult(RuleResult copy) { this.m_success = copy.m_success; this.m_message = copy.m_message; this.m_ruleType = copy.m_ruleType; this.m_ruleProperties = WebTestFrameworkHelperMethods.CloneCustomCollection<PropertyCollection, PluginOrRuleProperty>(copy.m_ruleProperties); this.m_ruleName = copy.m_ruleName; this.m_exception = new Exception(copy.m_exception.Message, copy.m_exception.InnerException); } } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)