Show / Hide Table of Contents

Class Runner

Provides default implementation of runner that executes code decorated with Runnable/Run attributes. This class IS NOT thread-safe

Inheritance
System.Object
DisposableObject
Runner
Implements
System.IDisposable
Inherited Members
DisposableObject.DisposeAndNull<T>(T)
DisposableObject.DisposeStarted
DisposableObject.Disposed
DisposableObject.Destructor()
DisposableObject.EnsureObjectNotDisposed()
DisposableObject.Dispose()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: NFX.Scripting
Assembly: NFX.dll
Syntax
public class Runner : DisposableObject, IDisposable

Constructors

Runner(Assembly, IRunnerHost, IConfigSectionNode)

Declaration
public Runner(Assembly asm, IRunnerHost host, IConfigSectionNode config)
Parameters
Type Name Description
System.Reflection.Assembly asm
IRunnerHost host
IConfigSectionNode config

Fields

Assembly

Runs artifacts from this assembly

Declaration
public readonly Assembly Assembly
Field Value
Type Description
System.Reflection.Assembly

CONFIG_ARGS_SECTION

Declaration
public const string CONFIG_ARGS_SECTION = "args"
Field Value
Type Description
System.String

DELIMITERS

Declaration
public static readonly char[] DELIMITERS
Field Value
Type Description
System.Char[]

Host

Host which gets the output of runner

Declaration
public readonly IRunnerHost Host
Field Value
Type Description
IRunnerHost

m_Args

Declaration
protected IConfigSectionNode m_Args
Field Value
Type Description
IConfigSectionNode

m_ArgsResolver

Declaration
protected Runner.argsVarResolver m_ArgsResolver
Field Value
Type Description
Runner.argsVarResolver

m_Categories

Declaration
protected string[] m_Categories
Field Value
Type Description
System.String[]

m_Methods

Declaration
protected string[] m_Methods
Field Value
Type Description
System.String[]

m_Names

Declaration
protected string[] m_Names
Field Value
Type Description
System.String[]

m_Namespaces

Declaration
protected string[] m_Namespaces
Field Value
Type Description
System.String[]

Properties

Args

Provides Runner instance arguments, default reads the sub-section of initial create args

Declaration
public virtual IConfigSectionNode Args { get; }
Property Value
Type Description
IConfigSectionNode

Categories

If set, applies category filter fixtures and test methods in the specified categories. Multiple categories are delimited by ',' or ';' or '|'

Declaration
[Config]
public string Categories { get; set; }
Property Value
Type Description
System.String

Emulate

If set, does not call method bodies, only preps for run but does not run methods

Declaration
[Config]
public bool Emulate { get; set; }
Property Value
Type Description
System.Boolean

Methods

If set filters the method names. Multiple patterns delimited by ',' or ';' or '|'

Declaration
[Config]
public string Methods { get; set; }
Property Value
Type Description
System.String

Names

If set filters by method case names (attribute instance names). Multiple patterns delimited by ',' or ';' or '|'

Declaration
[Config]
public string Names { get; set; }
Property Value
Type Description
System.String

Namespaces

If set filters the namespace names. Multiple patterns delimited by ',' or ';' or '|'

Declaration
[Config]
public string Namespaces { get; set; }
Property Value
Type Description
System.String

Methods

FilterMethod(Type, MethodInfo, RunAttribute, Boolean)

Determines if the runnable should run in which case returns true. Filter is based on this instance properties (such as Categories etc.)

Declaration
public virtual bool FilterMethod(Type tRunnable, MethodInfo mi, RunAttribute attr, bool runnableHasMethodLevelCategories)
Parameters
Type Name Description
System.Type tRunnable
System.Reflection.MethodInfo mi
RunAttribute attr
System.Boolean runnableHasMethodLevelCategories
Returns
Type Description
System.Boolean

FilterRunnable(Type, RunnableAttribute)

Determines if the runnable should run in which case returns true. Filter is based on this instance properties (such as Categories etc.)

Declaration
public virtual bool FilterRunnable(Type tRunnable, RunnableAttribute attr)
Parameters
Type Name Description
System.Type tRunnable
RunnableAttribute attr
Returns
Type Description
System.Boolean

GetRunMethods(Type)

Returns all run methods that satisfy filter (specified by this instance filter properties). The enumeration is not ordered

Declaration
public virtual IEnumerable<> GetRunMethods(Type tRunnable)
Parameters
Type Name Description
System.Type tRunnable
Returns
Type Description
System.Collections.Generic.IEnumerable<System.>

GetRunnables()

Returns all runnables that satisfy filter (specified by this instance filter properties). The enumeration is not ordered

Declaration
public virtual IEnumerable<> GetRunnables()
Returns
Type Description
System.Collections.Generic.IEnumerable<System.>

MakeMethodParameters()

Binds parameters supplied by RunAttribute into object[] as required by the supplied MethodInfo

Declaration
protected virtual object[] MakeMethodParameters(method)
Parameters
Type Name Description
System. method
Returns
Type Description
System.Object[]

Run()

Runs the methods. This default implementation is single-threaded sequential

Declaration
public virtual void Run()

RunAllMethods(FID, Object, IEnumerable<>)

Override to do parallel execution etc...

Declaration
protected virtual void RunAllMethods(FID id, object runnable, IEnumerable<> methods)
Parameters
Type Name Description
FID id
System.Object runnable
System.Collections.Generic.IEnumerable<System.> methods

SafeRunMethod(Object, )

Keep in mind this method may need to be thread-safe if RunAllMethods() is multi-threaded. Should not throw execution errors

Declaration
protected virtual void SafeRunMethod(object runnable, method)
Parameters
Type Name Description
System.Object runnable
System. method

Implements

System.IDisposable

Extension Methods

MiscUtils.NonNull<T>(T, Func<Exception>, String)
ObjectValueConversion.AsString(Object, String, ConvertErrorHandling)
ObjectValueConversion.AsNonNullOrEmptyString(Object)
ObjectValueConversion.AsLaconicConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsJSONConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsXMLConfig(Object, ConfigSectionNode, ConvertErrorHandling)
ObjectValueConversion.AsChar(Object, Char, ConvertErrorHandling)
ObjectValueConversion.AsNullableChar(Object, Nullable<Char>, ConvertErrorHandling)
ObjectValueConversion.AsByte(Object, Byte, ConvertErrorHandling)
ObjectValueConversion.AsNullableByte(Object, Nullable<Byte>, ConvertErrorHandling)
ObjectValueConversion.AsSByte(Object, SByte, ConvertErrorHandling)
ObjectValueConversion.AsNullableSByte(Object, Nullable<SByte>, ConvertErrorHandling)
ObjectValueConversion.AsShort(Object, Int16, ConvertErrorHandling)
ObjectValueConversion.AsNullableShort(Object, Nullable<Int16>, ConvertErrorHandling)
ObjectValueConversion.AsUShort(Object, UInt16, ConvertErrorHandling)
ObjectValueConversion.AsNullableUShort(Object, Nullable<UInt16>, ConvertErrorHandling)
ObjectValueConversion.AsInt(Object, Int32, ConvertErrorHandling)
ObjectValueConversion.AsNullableInt(Object, Nullable<Int32>, ConvertErrorHandling)
ObjectValueConversion.AsUInt(Object, UInt32, ConvertErrorHandling)
ObjectValueConversion.AsNullableUInt(Object, Nullable<UInt32>, ConvertErrorHandling)
ObjectValueConversion.AsLong(Object, Int64, ConvertErrorHandling)
ObjectValueConversion.AsNullableLong(Object, Nullable<Int64>, ConvertErrorHandling)
ObjectValueConversion.AsULong(Object, UInt64, ConvertErrorHandling)
ObjectValueConversion.AsNullableULong(Object, Nullable<UInt64>, ConvertErrorHandling)
ObjectValueConversion.AsDouble(Object, Double, ConvertErrorHandling)
ObjectValueConversion.AsNullableDouble(Object, Nullable<Double>, ConvertErrorHandling)
ObjectValueConversion.AsFloat(Object, Single, ConvertErrorHandling)
ObjectValueConversion.AsNullableFloat(Object, Nullable<Single>, ConvertErrorHandling)
ObjectValueConversion.AsDecimal(Object, Decimal, ConvertErrorHandling)
ObjectValueConversion.AsNullableDecimal(Object, Nullable<Decimal>, ConvertErrorHandling)
ObjectValueConversion.AsBool(Object, Boolean, ConvertErrorHandling)
ObjectValueConversion.AsNullableBool(Object, Nullable<Boolean>, ConvertErrorHandling)
ObjectValueConversion.AsGUID(Object, Guid, ConvertErrorHandling)
ObjectValueConversion.AsNullableGUID(Object, Nullable<Guid>, ConvertErrorHandling)
ObjectValueConversion.AsDateTime(Object)
ObjectValueConversion.AsDateTime(Object, DateTime, ConvertErrorHandling)
ObjectValueConversion.AsNullableDateTime(Object, Nullable<DateTime>, ConvertErrorHandling)
ObjectValueConversion.AsGDID(Object)
ObjectValueConversion.AsGDID(Object, GDID, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDID(Object, Nullable<GDID>, ConvertErrorHandling)
ObjectValueConversion.AsGDIDSymbol(Object)
ObjectValueConversion.AsGDIDSymbol(Object, GDIDSymbol, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDIDSymbol(Object, Nullable<GDIDSymbol>, ConvertErrorHandling)
ObjectValueConversion.AsTimeSpan(Object)
ObjectValueConversion.AsTimeSpan(Object, TimeSpan, ConvertErrorHandling)
ObjectValueConversion.AsNullableTimeSpan(Object, Nullable<TimeSpan>, ConvertErrorHandling)
ObjectValueConversion.AsEnum<TEnum>(Object, TEnum, ConvertErrorHandling)
ObjectValueConversion.AsNullableEnum<TEnum>(Object, Nullable<TEnum>, ConvertErrorHandling)
ObjectValueConversion.AsUri(Object, Uri, ConvertErrorHandling)
JSONExtensions.ToJSON(Object, JSONWritingOptions)
JSONExtensions.ToJSON(Object, TextWriter, JSONWritingOptions)
JSONExtensions.ToJSON(Object, Stream, JSONWritingOptions, Encoding)
ErlObject.ToErlObject(Object)
ErlObject.ToErlObject(Object, ErlTypeOrder, Boolean)
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX