← Back to team overview

nunit-core team mailing list archive

Re: [Question #141938]: Test a Suite of Fixture

 

Question #141938 on NUnit Framework changed:
https://answers.launchpad.net/nunit-3.0/+question/141938

    Status: Open => Answered

Charlie Poole proposed the following answer:
What is your intent in including a parameterized TestFixtureAttribute on
Fixture Runner? It would only be used in a normal run without specifying
a fixture and in that case would cause an error since no argument would
be provided for the constructor.

Assuming you are running the console with /fixture="AllTests", the
four fixtures should be executed. How are you determining that
this is not happening?

Charlie

On Tue, Jan 18, 2011 at 10:54 AM, Maxence MODELIN
<question141938@xxxxxxxxxxxxxxxxxxxxx> wrote:
> New question #141938 on NUnit Framework:
> https://answers.launchpad.net/nunit-3.0/+question/141938
>
> Hey,
> I would like to execute a specific of Fixtures. I can't use the "category" because I determine dynamically fixture to execute.
> So I followed the NUnit documentation (on http://www.nunit.org/index.php?p=suite&r=2.5.9), and my program looks to be the same  :
>
> public class AllTests
> {
>        [Suite()]
>        private static IEnumerable Suite
>        {
>            get
>            {
>                //irectory.GetFiles(ConfigurationPath.GetFolderPath(), "Test-*.psm1");
>
>                var suite = new ArrayList()
>                                      {
>                                          new FixtureRunner("Test-Install-IrisVente1.psm1"),
>                                          new FixtureRunner("Test-Install-IrisVente2.psm1"),
>                                          new FixtureRunner("Test-Install-IrisVente3.psm1"),
>                                          new FixtureRunner("Test-Install-IrisVente4.psm1")
>                                      };
>
>                return suite;
>            }
>        }
> }
>
>  [TestFixture(typeof(string))]
> public class FixtureRunner
> {
>        public FixtureRunner(string name)
>        {
>            [...]
>        }
>       [...]
>
> }
>
> When I call the console runner or the nunit Gui (through a command line), the same fixture is executed 4 times instead of executing 4 differents fixtures.
>
> Do you have any idea of how I could use Suite attribute ? Does it still work ?
> If not, how can I dynamically decide which fixture to run (a bit like TestCaseSource("FunctionsToTest") but with Fixture).
> Thanks for your answer,
> max
>
> --
> You received this question notification because you are a member of
> NUnit Core Developers, which is an answer contact for NUnit Framework.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~nunit-core
> Post to     : nunit-core@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~nunit-core
> More help   : https://help.launchpad.net/ListHelp
>

-- 
You received this question notification because you are a member of
NUnit Core Developers, which is an answer contact for NUnit Framework.