Actually, it is being applied to the method. However, in this situation, the method corresponds to a suite containing all your test cases, rather than to an individual test case. If we gave you the ability (we don't) to access the containing suite via something like TestContext.ParentTest, you could find the property there. However, that would involve writing methods for test cases differently from simple tests and I think it should be avoided.
I'm inclined to mark this bug "Won't Fix" but I'll give you a chance to make some suggestions first. :-) Charlie On Mon, Aug 5, 2013 at 3:36 AM, Dunemaster <vkl...@yandex.ru> wrote: > Public bug reported: > > NUnit 2.6.2 > I have a custom attribute for my property > > [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] > internal class NeedRecreateDataAttribute : PropertyAttribute > { > public const string PROPERTY_NAME = "NeedRecreateData"; > > public NeedRecreateDataAttribute() > : base(true) > { > > } > } > > It is applied ok when used with [Test] attribute: > > [Test] > [NeedRecreateData] > public void Test_Assign_String() > { > ... > } > > > [TearDown] > public void TestTeadDown() > { > if > (TestContext.CurrentContext.Test.Properties.Contains(NeedRecreateDataAttribute.PROPERTY_NAME)) > { > PrepareFixtureData(); > } > } > > > But when paired with [TestCase] attribute, the property is not applied > (TestContext.CurrentContext.Test.Properties.Contains(NeedRecreateDataAttribute.PROPERTY_NAME) > == false) > > ** Affects: nunitv2 > Importance: Undecided > Status: New > > -- > You received this bug notification because you are subscribed to NUnit > Extended Testing Platform. > https://bugs.launchpad.net/bugs/1208356 > > Title: > Properties are not applied for parameterized tests > > To manage notifications about this bug go to: > https://bugs.launchpad.net/nunitv2/+bug/1208356/+subscriptions > -- You received this bug notification because you are a member of NUnit Developers, which is subscribed to NUnit V2. https://bugs.launchpad.net/bugs/1208356 Title: Properties are not applied for parameterized tests Status in NUnit V2 Test Framework: New Bug description: NUnit 2.6.2 I have a custom attribute for my property [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] internal class NeedRecreateDataAttribute : PropertyAttribute { public const string PROPERTY_NAME = "NeedRecreateData"; public NeedRecreateDataAttribute() : base(true) { } } It is applied ok when used with [Test] attribute: [Test] [NeedRecreateData] public void Test_Assign_String() { ... } [TearDown] public void TestTeadDown() { if (TestContext.CurrentContext.Test.Properties.Contains(NeedRecreateDataAttribute.PROPERTY_NAME)) { PrepareFixtureData(); } } But when paired with [TestCase] attribute, the property is not applied (TestContext.CurrentContext.Test.Properties.Contains(NeedRecreateDataAttribute.PROPERTY_NAME) == false) To manage notifications about this bug go to: https://bugs.launchpad.net/nunitv2/+bug/1208356/+subscriptions _______________________________________________ Mailing list: https://launchpad.net/~nunit-core Post to : nunit-core@lists.launchpad.net Unsubscribe : https://launchpad.net/~nunit-core More help : https://help.launchpad.net/ListHelp