Passing dynamically generated value to NUnit Custom Attribute
问题 For our test scenarios - based on configuration of the application, we may want to either enable or disable a scenario. For this purpose, I created a custom IgnoreIfConfig Attribute like this : public class IgnoreIfConfigAttribute : Attribute, ITestAction { public IgnoreIfConfigAttribute(string config) { _config = config; } public void BeforeTest(ITest test) { if (_config != "Enabled") NUnit.Framework.Assert.Ignore("Test is Ignored due to Access level"); } public void AfterTest(ITest test) {