public ParameterizedTestResult(TestMethodInvokerContext context) { _methodName = context.TestMethodInfo.Name; _message = new StringBuilder(); _hasFailed = false; _testCount = 0; }
protected bool Matches(TestMethodInvokerContext invokerContext, DataRowValues dataRowValues) { if (this.idValues != null && (this.idValues.Contains(dataRowValues.Id) || this.idValues.Contains("*") || this.idValues.Contains(invokerContext.TestMethodInfo.Name + "." + dataRowValues.Id) || this.idValues.Contains(invokerContext.TestMethodInfo.Name + ".*"))) { return true; } return false; }
public override FilterInfo GetFilterInfo(TestMethodInvokerContext invokerContext, DataRowValues dataRowValues) { FilterInfo result = FilterInfo.None; if (this.Matches(invokerContext, dataRowValues)) { result |= FilterInfo.Exclude; if (this.ShowSkipped) { result |= FilterInfo.ShowSkipped; } else { result |= FilterInfo.HideSkipped; } } return result; }
public static ITestMethodInvoker Create(TestMethodInvokerContext context) { return new SimpleTestInvoker(context); }
/// <summary> /// Invoker constructor. Allows you to save off the context /// </summary> /// <param name="InvokerContext">context of the test/run</param> public ExtensionMethodInvoker(TestMethodInvokerContext InvokerContext) { this.invokerContext = InvokerContext; }
private static void SetExpandedPaths(RowAttribute[] rows, TestMethodInvokerContext invokerContext) { Debug.Assert(rows != null, "rows != null"); Debug.Assert(invokerContext != null, "invokerContext != null"); Dictionary<string, string> testContextPairs = null; // Process each RowAttribute, or derived attribute foreach (RowAttribute attr in rows) { // Prepare a custom list of test context key/value pairs is the row attribute needs it if (attr.NeedsTestContextPairs) { if (testContextPairs == null) { testContextPairs = new Dictionary<string, string>(); foreach (object key in invokerContext.TestContext.Properties.Keys) { object value = invokerContext.TestContext.Properties[key]; testContextPairs.Add(key.ToString(), value.ToString()); } } // Let the row driver adjust its paths for its own purposes attr.SetExpandedPath(testContextPairs); } } }
private static void PopulateRowSkippedInfo(TestMethodInvokerContext invokerContext, RowTestContext rowTestContext, IList<RowFilterAttribute> filters) { FilterInfo filterInfo = filters.Select(filter => filter.GetFilterInfo(invokerContext, rowTestContext.DataRowValues)) .Aggregate(FilterInfo.None, (acc, f) => acc | f); rowTestContext.Ignored = false; rowTestContext.ShowSkipped = true; // Process execution flags. if ((filterInfo & FilterInfo.Exclude) != FilterInfo.None) { rowTestContext.Ignored = true; } if ((filterInfo & FilterInfo.Include) != FilterInfo.None) { rowTestContext.Ignored = false; } // Process display flags if ((filterInfo & FilterInfo.HideSkipped) != FilterInfo.None) { rowTestContext.ShowSkipped = false; } if ((filterInfo & FilterInfo.ShowSkipped) != FilterInfo.None) { rowTestContext.ShowSkipped = true; } if (rowTestContext.DataRowValues.Ignore) { rowTestContext.Ignored = true; } }
public override ITestMethodInvoker CreateTestMethodInvoker(TestMethodInvokerContext context) { return new ParameterizedTestInvoker(context); }
public ExtendedTestInvoker(TestMethodInvokerContext context) { Context = context; }
public override ITestMethodInvoker CreateTestMethodInvoker(TestMethodInvokerContext context) { return new ExtendedTestInvoker(context); }
public TestLooperInvoker(TestMethodInvokerContext InvokerContext, string PropertyName) { m_invokerContext = InvokerContext; this.PropertyName = PropertyName; }
public virtual FilterInfo GetFilterInfo(TestMethodInvokerContext invokerContext, DataRowValues dataRowValues) { return FilterInfo.None; }
public override ITestMethodInvoker CreateTestMethodInvoker(TestMethodInvokerContext InvokerContext) { return new TestLooperInvoker(InvokerContext, PropertyName); }
public TestLooperInvoker(TestMethodInvokerContext InvokerContext, string PropertyName) { m_invokerContext = InvokerContext; this.PropertyName = PropertyName; }
public override ITestMethodInvoker CreateTestMethodInvoker(TestMethodInvokerContext InvokerContext) { return new TestLooperInvoker(InvokerContext, PropertyName); }
/// <summary> /// Returns the object that will be used to invoke the test method /// </summary> /// <param name="InvokerContext">Contains information about the run and the test being executed</param> /// <returns>Invoker object</returns> public override ITestMethodInvoker CreateTestMethodInvoker(TestMethodInvokerContext InvokerContext) { return new ExtensionMethodInvoker(InvokerContext); }
public override ITestMethodInvoker CreateTestMethodInvoker(TestMethodInvokerContext context) { var invoker = TestInvoker.Create(context); return invoker; }
public SimpleTestInvoker(TestMethodInvokerContext context) { }
public ParameterizedTestInvoker(TestMethodInvokerContext context) { _context = context; }
private static IEnumerable<DataRowValues> GetAllDataRowValues(RowAttribute[] rows, TestMethodInvokerContext invokerContext, HelperTestGridResults results) { Debug.Assert(rows != null, "rows != null"); Debug.Assert(invokerContext != null, "invokerContext != null"); Debug.Assert(results != null, "results != null"); if (rows.Length > 0) { Assembly testMethodAssembly = invokerContext.TestMethodInfo.DeclaringType.Assembly; // Process each RowAttribute, or derived attribute foreach (RowAttribute attr in rows) { // enumerate row data and invoke the test case with each yield they give us foreach (DataRowValues dataRowValues in attr.GetRowEnumerator(testMethodAssembly, results)) { if (attr.Ignore) { dataRowValues.Ignore = true; } yield return dataRowValues; } } } else { yield return new DataRowValues(); } }
public override ITestMethodInvoker OverrideTestMethodInvoker(ITestMethodInvoker testMethodInvoker, TestMethodInvokerContext originalInvokerContext, RowTestContext rowTestContext) { return new Invoker() { OriginalInvoker = testMethodInvoker }; }