Click here to Skip to main content
15,896,915 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 LightWebTestFramework.Rules;
using System;
using System.Collections.Generic;
namespace LightWebTestFramework
{
	[Serializable]
	public class WebTestResultLoopIteration : WebTestResultGroup, ICloneable
	{
		private int m_iterationNumber;
		private WebTestRequestResult m_requestResult;
		private string m_uniqueStringId;
		private bool m_errorOccurred;
		private WebTestLoop m_loop;
		private bool m_stopLoopIteration;
		private WebTestLoopIterationRunStatus m_runStatus;
		public int IterationNumber
		{
			get
			{
				return this.m_iterationNumber;
			}
			internal set
			{
				this.m_iterationNumber = value;
			}
		}
		public WebTestRequestResult RequestResult
		{
			get
			{
				if (this.m_requestResult == null)
				{
					this.m_requestResult = new WebTestRequestResult(new WebTestContext(), new RuleResult());
				}
				return this.m_requestResult;
			}
			internal set
			{
				this.m_requestResult = value;
			}
		}
		public string UniqueStringId
		{
			get
			{
				return this.m_uniqueStringId;
			}
			internal set
			{
				this.m_uniqueStringId = value;
			}
		}
		public bool ErrorOccurred
		{
			get
			{
				return this.m_errorOccurred;
			}
			internal set
			{
				this.m_errorOccurred = value;
			}
		}
		public bool StopLoopIteration
		{
			get
			{
				return this.m_stopLoopIteration;
			}
			internal set
			{
				this.m_stopLoopIteration = value;
			}
		}
		internal WebTestLoopIterationRunStatus RunStatus
		{
			get
			{
				return this.m_runStatus;
			}
			set
			{
				this.m_runStatus = value;
			}
		}
		public override bool Passed
		{
			get
			{
				return !this.m_errorOccurred && base.Passed;
			}
		}
		internal WebTestResultLoopIteration()
		{
		}
		internal WebTestResultLoopIteration(WebTestLoop loop, int iterationNumber)
		{
			this.m_loop = loop;
			this.m_iterationNumber = iterationNumber;
			this.m_uniqueStringId = loop.UniqueStringId + iterationNumber;
			this.m_requestResult = null;
			base.DeclarativeWebTestItemId = loop.ItemId;
		}
		internal WebTestResultLoopIteration(WebTestResultLoopIteration copy) : base(copy)
		{
			this.Update(copy);
		}
		public override object Clone()
		{
			return new WebTestResultLoopIteration(this);
		}
		internal void AddConditionallySkippedChildren()
		{
			if (base.Children.Count == 0 && this.m_loop != null)
			{
				base.AddNonExecutedChildren(base.Children, this.m_loop.Items, WebTestResultStatus.ConditionallySkipped);
			}
		}
		internal List<WebTestResultUnit> GetTemplateChildren()
		{
			List<WebTestResultUnit> list = new List<WebTestResultUnit>();
			if (this.m_loop != null)
			{
				base.AddNonExecutedChildren(list, this.m_loop.Items, WebTestResultStatus.TemplateResult);
			}
			return list;
		}
		public bool IsConditionalRuleMet()
		{
			return !this.m_errorOccurred && this.RequestResult.ConditionalRuleResult.Success;
		}
		internal void Update(WebTestResultLoopIteration updatedLoopIterationResult)
		{
			this.m_loop = updatedLoopIterationResult.m_loop;
			this.m_iterationNumber = updatedLoopIterationResult.m_iterationNumber;
			this.m_uniqueStringId = updatedLoopIterationResult.m_uniqueStringId;
			this.m_requestResult = updatedLoopIterationResult.m_requestResult;
			this.m_runStatus = updatedLoopIterationResult.m_runStatus;
			this.m_errorOccurred = updatedLoopIterationResult.m_errorOccurred;
			this.m_stopLoopIteration = updatedLoopIterationResult.m_stopLoopIteration;
			base.SourceWebTestId = updatedLoopIterationResult.SourceWebTestId;
			base.ResultStatus = updatedLoopIterationResult.ResultStatus;
		}
	}
}

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