Click here to Skip to main content
15,895,746 members
Articles / Code generation

Semi generated crawler

Rate me:
Please Sign up or sign in to vote.
5.00/5 (3 votes)
22 Jun 2012CPOL4 min read 21.6K   599   10  
Leverage Visual studio Web Test Framework for your crawling needs...
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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer Freelance
France France
I am currently the CTO of Metaco, we are leveraging the Bitcoin Blockchain for delivering financial services.

I also developed a tool to make IaaS on Azure more easy to use IaaS Management Studio.

If you want to contact me, go this way Smile | :)

Comments and Discussions