public DenyEnvironmentRunInvoker(
     IRunInvoker invoker,
     DenyEnvironmentAttribute attribute)
     : base(invoker)
 {
     this.attribute = attribute;
 }
 public DenyDnsRunInvoker(
     IRunInvoker invoker,
     DenyDnsAttribute attribute)
     : base(invoker)
 {
     this.attribute = attribute;
 }
Esempio n. 3
0
 public DBDataRunInvoker(
     IRunInvoker invoker,
     DenyDBDataAttribute attribute)
     : base(invoker)
 {
     this.attribute = attribute;
 }
 public DenyFileDialogAccessRunInvoker(
     IRunInvoker invoker,
     DenyFileDialogAttribute attribute)
     : base(invoker)
 {
     this.attribute = attribute;
 }
 public DenyWindowRunInvoker(
     IRunInvoker invoker,
     DenyUIAttribute attribute)
     : base(invoker)
 {
     this.attribute = attribute;
 }
Esempio n. 6
0
		public ExecuteException(
		    IRunInvoker invoker, 
		    Object tested,
		    IList args
		    )
		   :base(invoker,tested,args)
		{}
Esempio n. 7
0
            /// <summary>
            /// Initializes a new instance of the <see cref="PerfCounterRunInvoker"/> class.
            /// </summary>
            /// <param name="invoker">The test invoker.</param>
            /// <param name="attribute">The <see cref="PerfCounterAttribute"/> tagging the test method.</param>
            public PerfCounterRunInvoker(IRunInvoker invoker, PerfCounterAttribute attribute)
                : base(invoker)
            {
                this.attribute            = attribute;
                this.counter              = new PerformanceCounter();
                this.counter.CategoryName = attribute.CategoryName;
                this.counter.CounterName  = attribute.CounterName;

                Process currentProcesss = Process.GetCurrentProcess();

                if (attribute.InstanceName != null)
                {
                    this.counter.InstanceName = attribute.InstanceName;
                }
                else
                {
                    this.counter.InstanceName = currentProcesss.ProcessName;
                }

                if (attribute.MachineName != null)
                {
                    this.counter.MachineName = attribute.MachineName;
                }
                else
                {
                    this.counter.MachineName = currentProcesss.MachineName;
                }
            }
Esempio n. 8
0
 public DenyFileIORunInvoker(
     IRunInvoker invoker,
     DenyFileIOAttribute attribute)
     : base(invoker)
 {
     this.attribute = attribute;
 }
Esempio n. 9
0
 public DenyPrintingRunInvoker(
     IRunInvoker invoker,
     DenyPrintingAttribute attribute)
     : base(invoker)
 {
     this.attribute = attribute;
 }
Esempio n. 10
0
        public override IRunInvoker GetInvoker(IRunInvoker wrapped)
        {
            ChangeCultureRunInvoker invoker =
                new ChangeCultureRunInvoker(this.name, wrapped);

            return(invoker);
        }
 public DenyFileDialogAccessRunInvoker(
     IRunInvoker invoker,
     DenyFileDialogAttribute attribute)
     : base(invoker)
 {
     this.attribute = attribute;
 }
Esempio n. 12
0
 public DenyReflectionRunInvoker(
     IRunInvoker invoker,
     DenyReflectionAttribute attribute)
     : base(invoker)
 {
     this.attribute = attribute;
 }
Esempio n. 13
0
 public DenyDnsRunInvoker(
     IRunInvoker invoker,
     DenyDnsAttribute attribute)
     : base(invoker)
 {
     this.attribute = attribute;
 }
 public DenyPrintingRunInvoker(
     IRunInvoker invoker,
     DenyPrintingAttribute attribute)
     : base(invoker)
 {
     this.attribute = attribute;
 }
Esempio n. 15
0
        public RunInvokerVertex AddChild(RunInvokerVertex parent, IRunInvoker child)
        {
            if (parent == null)
            {
                throw new ArgumentNullException("parent");
            }
            if (child == null)
            {
                throw new ArgumentNullException("child");
            }

            // create vertex
            RunInvokerVertex v = (RunInvokerVertex)this.graph.AddVertex();

            // decorate with fixture decorators if needed
            IRunInvoker invoker = child;

            //if (invoker.Generator.IsTest)
            invoker   = this.DecorateInvokerWithFixtureDecorators(invoker);
            v.Invoker = invoker;

            // add edge
            this.graph.AddEdge(parent, v);

            return(v);
        }
Esempio n. 16
0
 public DenyEnvironmentRunInvoker(
     IRunInvoker invoker,
     DenyEnvironmentAttribute attribute)
     : base(invoker)
 {
     this.attribute = attribute;
 }
 public DenyFileIORunInvoker(
     IRunInvoker invoker,
     DenyFileIOAttribute attribute)
     : base(invoker)
 {
     this.attribute = attribute;
 }
Esempio n. 18
0
 public DenyWindowRunInvoker(
     IRunInvoker invoker,
     DenyUIAttribute attribute)
     : base(invoker)
 {
     this.attribute = attribute;
 }
 public DBDataRunInvoker(
     IRunInvoker invoker,
     DenyDBDataAttribute attribute)
     : base(invoker)
 {
     this.attribute = attribute;
 }
Esempio n. 20
0
		public ThreadedRepeatRunInvoker(IRunInvoker invoker, int count) 
		:base(invoker)
		{
			if (count<1)
				throw new ArgumentException("count must be greate or equal than 1");
			this.count = count;
		}
Esempio n. 21
0
		protected ExecuteException(
			IRunInvoker invoker, 
		    Object tested,
		    IList args,
			SerializationInfo info, StreamingContext context)
		:base(invoker,tested,args,info,context)
		{}
Esempio n. 22
0
 /// <summary>
 /// Adds an instance of type IRunInvoker to the end of this IRunInvokerCollection.
 /// </summary>
 /// <param name="value">
 /// The IRunInvoker to be added to the end of this IRunInvokerCollection.
 /// </param>
 public void Add(IRunInvoker value)
 {
     if (value == null)
     {
         throw new ArgumentNullException("value");
     }
     this.List.Add(value);
 }
 public override IRunInvoker GetInvoker(IRunInvoker invoker)
 {
     return new ConditionalExceptionRunInvoker(
         invoker,
         this.ExceptionType,
         this.Description,
         this.predicateMethodName);
 }
 public MultipleCultureRunInvoker(IRunInvoker invoker, 
     MultipleCultureAttribute attribute)
     : base(invoker)
 {
     if (attribute==null)
         throw new ArgumentNullException("attribute");
     this.attribute = attribute;
 }
Esempio n. 25
0
 protected ExecuteException(
     IRunInvoker invoker,
     Object tested,
     IList args,
     SerializationInfo info, StreamingContext context)
     : base(invoker, tested, args, info, context)
 {
 }
Esempio n. 26
0
 public ExecuteException(
     IRunInvoker invoker,
     Object tested,
     IList args
     )
     : base(invoker, tested, args)
 {
 }
 public DenyIsolatedRunInvoker(
     IRunInvoker invoker,
     DenyIsolatedFileStorageAttribute attribute)
     : base(invoker)
 {
     this.attribute  = attribute;
     this.PermitOnly = true;
 }
 public DenyIsolatedRunInvoker(
     IRunInvoker invoker,
     DenyIsolatedFileStorageAttribute attribute)
     : base(invoker)
 {
     this.attribute = attribute;
     this.PermitOnly = true;
 }
 public PushEnvironmentVariableRunInvoker(
     IRunInvoker invoker,
     PushEnvironmentVariableAttribute attribute
     )
     : base(invoker)
 {
     this.attribute = attribute;
 }
Esempio n. 30
0
 public override void Reflect(RunInvokerTree tree, RunInvokerVertex parent, Type t)
 {
     foreach (MethodInfo mi in TypeHelper.GetAttributedMethods(t, this.framework.TestAttributeType))
     {
         IRunInvoker invoker = this.CreateInvoker(mi);
         tree.AddChild(parent, invoker);
     }
 }
 public DenyAspNetHostingRunInvoker(
     IRunInvoker invoker,
     DenyAspNetHostingAttribute attribute)
     : base(invoker)
 {
     this.attribute = attribute;
     this.PermitOnly = true;
 }
Esempio n. 32
0
 /// <summary>
 /// Default constructor - initializes all fields to default values
 /// </summary>
 public InvokerEventArgs(IRunInvoker invoker)
 {
     if (invoker == null)
     {
         throw new ArgumentNullException("invoker");
     }
     this.invoker = invoker;
 }
Esempio n. 33
0
 /// <summary>
 /// Returns a <see cref="ConditionalExceptionRunInvoker"/> object to invoke the test if the predicate is true
 /// </summary>
 /// <param name="invoker">The standard test invoker derived from <see cref="IRunInvoker"/></param>
 /// <returns>A <see cref="ConditionalExceptionRunInvoker"/> object to invoke the test if the predicate is true</returns>
 public override IRunInvoker GetInvoker(IRunInvoker invoker)
 {
     return(new ConditionalExceptionRunInvoker(
                invoker,
                this.ExceptionType,
                this.Description,
                this.predicateMethodName));
 }
Esempio n. 34
0
		public ExecuteException(
		    IRunInvoker invoker, 
		    Object tested,
		    IList args,
		    string message
		    )
		:base(invoker,tested,args,message)
		{}
 public PushEnvironmentVariableRunInvoker(
     IRunInvoker invoker,
     PushEnvironmentVariableAttribute attribute
     )
     : base(invoker)
 {
     this.attribute = attribute;
 }
Esempio n. 36
0
		protected DecoratorRunInvoker(IRunInvoker invoker, string description) 
		{
			if (invoker == null)
				throw new ArgumentNullException("invoker");
			
			this.invoker = invoker;
            this.description = description;
        }
Esempio n. 37
0
 public RepeatRunInvoker(IRunInvoker invoker, int count)
     : base(invoker)
 {
     if (count < 1)
     {
         throw new ArgumentException("count must be greate or equal than 1");
     }
     this.count = count;
 }
Esempio n. 38
0
        protected IRunInvoker InstanceInvoker(MethodInfo mi)
        {
            Object[] args = new Object[2];
            args[0] = this;
            args[1] = mi;
            IRunInvoker invoker = (IRunInvoker)this.invokerConstructor.Invoke(args);

            return(DecoratorPatternAttribute.DecoreInvoker(mi, invoker));
        }
Esempio n. 39
0
 public ExecuteException(
     IRunInvoker invoker,
     Object tested,
     IList args,
     string message
     )
     : base(invoker, tested, args, message)
 {
 }
        public ExpectedExceptionRunInvoker(IRunInvoker invoker, Type exceptionType, string expectedMessage, Type innerExceptionType, 
            string description) : base(invoker, description)
		{
			if (exceptionType == null)
				throw new ArgumentNullException("exceptionType");
			this.exceptionType = exceptionType;
            this.expectedMessage = expectedMessage;
            this.innerExceptionType = innerExceptionType;
        }
Esempio n. 41
0
 public static IRunInvoker DecoreInvoker(MethodInfo mi, IRunInvoker invoker)
 {
     // looking for decoring attributes
     foreach (DecoratorPatternAttribute deco in
              mi.GetCustomAttributes(typeof(DecoratorPatternAttribute), true))
     {
         invoker = deco.GetInvoker(invoker);
     }
     return(invoker);
 }
Esempio n. 42
0
        protected DecoratorRunInvoker(IRunInvoker invoker, string description)
        {
            if (invoker == null)
            {
                throw new ArgumentNullException("invoker");
            }

            this.invoker     = invoker;
            this.description = description;
        }
Esempio n. 43
0
		public InvokerException(
		    IRunInvoker invoker, 
		    Object tested,
		    IList args
		    )
		{
			this.invoker = invoker;
			this.tested = tested;
			this.args = args;
		}
Esempio n. 44
0
		public DurationRunInvoker(
			IRunInvoker invoker, 
			DurationAttribute attribute
			)
		:base(invoker)
		{
			if (attribute==null)
				throw new ArgumentNullException("attribute");
			this.attribute = attribute;
		}
		public static IRunInvoker DecoreInvoker(MethodInfo mi, IRunInvoker invoker)
		{
			// looking for decoring attributes
			foreach(DecoratorPatternAttribute deco in 
				mi.GetCustomAttributes(typeof(DecoratorPatternAttribute),true))
			{
				invoker = deco.GetInvoker(invoker);				
			}			
			return invoker;
		}
Esempio n. 46
0
 public InvokerException(
     IRunInvoker invoker,
     Object tested,
     IList args
     )
 {
     this.invoker = invoker;
     this.tested  = tested;
     this.args    = args;
 }
Esempio n. 47
0
 /// <summary>
 /// Constructs a execute functor
 /// </summary>
 /// <param name="invoker">invoker to execute</param>
 /// <param name="o"><see cref="IRunInvoker"/>.Execute arguments</param>
 /// <param name="args"><see cref="IRunInvoker"/>.Execute arguments</param>
 public ThreadedRunInvokerStarter(
     IRunInvoker invoker,
     Object o,
     IList args
     )
 {
     this.invoker = invoker;
     this.o       = o;
     this.args    = args;
 }
Esempio n. 48
0
 public MultipleCultureRunInvoker(IRunInvoker invoker,
                                  MultipleCultureAttribute attribute)
     : base(invoker)
 {
     if (attribute == null)
     {
         throw new ArgumentNullException("attribute");
     }
     this.attribute = attribute;
 }
Esempio n. 49
0
 protected InvokerException(
     IRunInvoker invoker,
     Object tested,
     IList args,
     SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     this.invoker = invoker;
     this.tested  = tested;
     this.args    = args;
 }
Esempio n. 50
0
		protected InvokerException(
			IRunInvoker invoker, 
		    Object tested,
		    IList args,
			SerializationInfo info, StreamingContext context)
		:base(info,context)
		{
			this.invoker = invoker;
			this.tested = tested;
			this.args = args;
		}
Esempio n. 51
0
 public ExpectedExceptionRunInvoker(IRunInvoker invoker, Type exceptionType, string expectedMessage, Type innerExceptionType,
                                    string description) : base(invoker, description)
 {
     if (exceptionType == null)
     {
         throw new ArgumentNullException("exceptionType");
     }
     this.exceptionType      = exceptionType;
     this.expectedMessage    = expectedMessage;
     this.innerExceptionType = innerExceptionType;
 }
		public ConditionalExceptionRunInvoker(
		        IRunInvoker invoker,
		        Type exceptionType,
                string description,
		        string predicateMethodName
		        )
		:base(invoker,exceptionType,description)
		{
			if (predicateMethodName==null)
				throw new ArgumentNullException("predicateMethodName");
			this.predicateMethodName = predicateMethodName;
		}
Esempio n. 53
0
		public InvokerException(
		    IRunInvoker invoker, 
		    Object tested,
		    IList args,
		    string message
		    )
		:base(message)
		{
			this.invoker = invoker;
			this.tested = tested;
			this.args = args;
		}
Esempio n. 54
0
 public DurationRunInvoker(
     IRunInvoker invoker,
     DurationAttribute attribute
     )
     : base(invoker)
 {
     if (attribute == null)
     {
         throw new ArgumentNullException("attribute");
     }
     this.attribute = attribute;
 }
Esempio n. 55
0
		protected MethodDurationException(
		    double minDuration,
		    double maxDuration,
		    double actualDuration,
			IRunInvoker invoker, 
		    Object tested,
		    IList args,
			SerializationInfo info, StreamingContext context)
		:base(invoker,tested,args,info,context)
		{
			this.minDuration = minDuration;
			this.maxDuration = maxDuration;
			this.actualDuration = actualDuration;
		}
 public MethodDurationException(
     double minDuration,
     double maxDuration,
     double actualDuration,
     IRunInvoker invoker,
     Object tested,
     IList args
     )
     : base(invoker,tested,args)
 {
     this.minDuration = minDuration;
     this.maxDuration = maxDuration;
     this.actualDuration = actualDuration;
 }
Esempio n. 57
0
        /// <summary>
        /// Initializes a new <see cref="TestCase"/> instance
        /// with name and delegate.
        /// </summary>
        /// <param name="name">
        /// Name of the test case
        /// </param>
        /// <param name="testDelegate">
        /// Delegate called by the test case
        /// </param>
        /// <param name="parameters">
        /// Parameters of the delegate
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="name"/> or <paramref name="testDelegate"/>
        /// is a null reference (Nothing in Visual Basic)
        /// </exception>
        /// <exception cref="ArgumentException">
        /// <paramref name="name"/> is empty.
        /// </exception>
        public TestCase(string name, Delegate testDelegate, params Object[] parameters)
        {
            if (name == null)
                throw new ArgumentNullException("name");
            if (name.Length == 0)
                throw new ArgumentException("name is empty");
            if (testDelegate == null)
                throw new ArgumentNullException("testDelegate");
            this.name = name;
            this.testDelegate = testDelegate;
            this.parameters = parameters;

            DelegateRunInvoker delegateInvoker = new DelegateRunInvoker(new TestCaseRun(), testDelegate, parameters);
            this.invoker = DecoratorPatternAttribute.DecoreInvoker(testDelegate.Method, delegateInvoker);
        }
 public MethodDurationException(
     double minDuration,
     double maxDuration,
     double actualDuration,
     IRunInvoker invoker,
     Object tested,
     IList args,
     string message,
     Exception innerException
     )
     : base(invoker,tested,args,message,innerException)
 {
     this.minDuration = minDuration;
     this.maxDuration = maxDuration;
     this.actualDuration = actualDuration;
 }
Esempio n. 59
0
        /// <summary>
        /// Returns the invoker class to run the test with the given duration parameters.
        /// </summary>
        /// <param name="invoker">The invoker currently set to run the test.</param>
        /// <returns>A new <see cref="MultipleCultureRunInvoker"/> object wrapping <paramref name="invoker"/></returns>
		public override IRunInvoker GetInvoker(IRunInvoker invoker)
		{
			return new MultipleCultureRunInvoker(invoker, this);
		}
 public ChangeCultureRunInvoker(string cultureName, IRunInvoker invoker)
     : base(invoker)
 {
     this.cultureName = cultureName;
 }