Re: Another Little 2.5 Data Testing Issue

"Kelly Anderson" <[email protected]> Mon, 19 May 2008 11:37:38 -0600
Newsgroups gmane.comp.windows.dotnet.nunit.devel
Message-ID <[email protected]>
On Mon, May 19, 2008 at 5:01 AM, Charlie Poole
<[email protected]> wrote:
> Hi Kelly,
>
> That makes a bit more sense now. I see two sub-problems here:
>
> 1) What you want to do is not possible, but it appears possible.

Right. That becomes a documentation issue.

> 2) What you want to do is not possible, but maybe it should be possible.

Possibly. Or some other thing like that.

> I would like to make it clear that it is not possible in the static
> case while making it possible in the dynamic case, but I'm not sure
> how to do it yet.

When you say "dynamic case" are you referring to a case where you
dynamically instantiate the testFixture class instance and then invoke
functions on it like I do in IterativeTest, or are you referring to
some other dynamicness?

> One issue to bear in mind is that putting the method in the test fixture
> class is what makes it appear that TestFixtureSetUp should work this way.
> That's one reason I prefer to put it in a different class.

Perhaps. One of the things that I want to accomplish in all of this is
to make it easy to use and learn. The separate classes seem to work
against that a bit. IterativeTest took a VERY simple approach, perhaps
TOO simple, but I wonder if there might be some happier ground in the
middle somewhere. Figuring out where to draw the line is a bit tricky
to be sure.

> Charlie
>
>> Ok, here's what I wanted to do (before I thought about it)...
>>
>> [TestFixture]
>> public void setupDirectory()
>> {
>>   SetStandardDirectoryRoot(@"C:\kelly");
>> }
>>
>> IEnumerable MyFiles
>> {
>>    // make and return a list of the files in C:\Kelly }
>>
>> [DataSource("MyFiles")]
>> public void test()
>> {
>>   // Tests something about the files.
>> }

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/