nunit-core team mailing list archive
-
nunit-core team
-
Mailing list archive
-
Message #01023
[Bug 633884] Re: TestCaseSource does not use Arguments, Categories etc as described in documentation for 2.5.7
Thanks. I'm afraid I don't understand your recommendation.
This is the first bit I don't follow:
"If you want your test to process the contents of your own struct or class, then use it as an argument and return that type."
Do you mean
[TestCaseSource(typeof(SimTestDataGenerator), "TestArguments")]
public void IndividualTestCasesShouldBeGenerated(Type simTestDescriptorClass) ?
What do I return "that type" from?
Sorry but I'm feeling pretty foolish here. Can you give me an example?
I don't follow this either:
"If you want NUnit to perform processing described, then the actual arguments should be stored in an Arguments member."
A member of which class?
You also say
"In fact, in that case, you may as well use TestCaseData, which contains all the functionality you are looking for and will also continue to work under NUnit 3.0, where we no longer use reflection in this way."
I don't want to write code that will be deprecated in the next version
of NUnit so does that mean TestCaseData will be the only way forward?
I don't think I'm stupid but I'm coming at this for the first time and I
suspect the gulf between your familiarity and mine is the problem.
Thanks for your time.
--
TestCaseSource does not use Arguments, Categories etc as described in documentation for 2.5.7
https://bugs.launchpad.net/bugs/633884
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.
Status in NUnit V2 Test Framework: Triaged
Bug description:
What happens:
Created a class X that is returned as an IEnumerable<X> in method M of class Z.
This is used in [TestCaseSource(typeof(Z), "M"]
Class X has been given
public string TestName { get; private set; }
public IList<string> Categories { get; private set; }
public bool Ignored;
In the constructor for X, these have been initialised
this.Categories = new List<string> { "foo" };
this.TestName = note;
this.Ignored = true;
The test is executed(contrary to Ignored==true).
There are no categories in the NUinit GUI.
The test is not renamed.
What I expect:
The test is flagged as ignore.
There is a category "foo".
The test is named after the string value in TestName.
NUnit 2.5.7.
Nunit.exe (GUI)
Follow ups
References