Allow to add properties to TestContext from ... - GitHub
github.com › Microsoft › testfxFeb 20, 2019 · While creating my custom test method attribute, I want set some data in the TestContext so it can be available for the test to behave depending on its value. I don't want to use DataRows or data source related approach because I want it to work in parallel. [AttributeUsage (AttributeTargets.Method, AllowMultiple = false)] public class IterativeTestMethodAttribute : TestMethodAttribute { private int stabilityThreshold; public IterativeTestMethodAttribute (int stabilityThreshold) { this.
TestContext | NUnit Docs
docs.nunit.org › writing-tests › TestContextThe TestParameters object supports the following properties: Count - The number of parameters. Names - A collection of the names of the supplied parameters. this [string name] - The value of a parameter. In Vb, use Item. The TestParameters object supports the following methods: Exists (string name) - Returns true if a parameter of that name exists.
c# - Understanding the MSTest TestContext - Stack Overflow
stackoverflow.com › questions › 24249133Jun 17, 2014 · You can get this from the TestContext.TestName property. I found an unexpected difference in behaviour between a static TestContext that is passed in to the [ClassInitialize] method and one that is declared as a public property (and gets set by the test runner). Consider the following code: using System; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace TestContext.Tests { [TestClass] public class UnitTest1 { public TestContext TestContext { get; set; } private static ...