Not quite.
The testing framework computes the cartesian or pairwise product for you
automatically.  All you need to do it put the data source attributes on the
parameters of the test method.
 
Here's an example combining a Factory data source and a Column data source.
The test will be run 6 times.
 
public IEnumerable<int> MyFactory()
{
    yield return 42;
    yield return 53;
}
 
[Test]
public void MyTest([Factory("MyFactory]")] int x, [Column(1, 2, 3)] int y)
{
}
 
You might also want to investigate the [PairwiseJoin] attribute.
 
Jeff.

  _____  

From: [email protected] [mailto:[email protected]] On
Behalf Of mark Kharitonov
Sent: Sunday, August 09, 2009 6:47 AM
To: [email protected]
Subject: Re: How to create a combinatorial test in MbUnit v3 using
factories?


Thanks Jeff, but I did not get from your reply how can I achieve the same
effect as CombinatorialTest attribute combined with Factory and
UsingFactories. Do you mean that the unit test writer has to calculate the
cartesian multiplication space manually, and yield it from some factory
method?

Isn't it a regression from v2, where the testing framework did it
automatically for the tester?


On Sun, Aug 9, 2009 at 12:31 PM, Jeff Brown <[email protected]> wrote:



You can apply any data source attribute to a test method parameter, test
fixture property or field.

So if [Column] isn't right for a particular case, then you can use [Factory]
or [CsvData] or any of the others.  :-)

Jeff.


-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Mark Kharitonov
Sent: Sunday, August 09, 2009 12:07 AM
To: MbUnit.User
Subject: How to create a combinatorial test in MbUnit v3 using factories?


Hello.
In MbUnit v2 one can write a combinatorial test where the members of
cartesian multiplication are produced by factory methods, meaning they are
unknown at the compile time. For an example see here -
http://blog.dotnetwiki.org/CombinatorialTestInTheHeartOfMbUnit.aspx.

How can one achieve the same feat in v3? The Column attribute is not good,
because it seem to require compile time knowledge of the values to be
combined. So, how can one do it in v3?

Thanks.








-- 
Be well and prosper.
==============================
"There are two kinds of people.Those whose guns are loaded and those who
dig."
  ("The good, the bad and the ugly")
So let us drink for our guns always be loaded.






--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MbUnit.User" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/MbUnitUser?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to