2023-05-03 11:06:20 +02:00
|
|
|
== Why is this an issue?
|
|
|
|
|
2021-06-08 14:23:48 +02:00
|
|
|
NUnit ``++TestFixture++``s may only have one ``++[SetUp]++`` method. Any more than that and the ``++TestFixture++`` will compile but not run.
|
|
|
|
|
|
|
|
|
2023-05-03 11:06:20 +02:00
|
|
|
=== Noncompliant code example
|
2021-06-08 14:23:48 +02:00
|
|
|
|
2022-02-04 17:28:24 +01:00
|
|
|
[source,csharp]
|
2021-06-08 14:23:48 +02:00
|
|
|
----
|
|
|
|
namespace NUnit.Tests
|
|
|
|
{
|
|
|
|
using System;
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
|
[TestFixture]
|
|
|
|
public class MyTests
|
|
|
|
{
|
|
|
|
[SetUp] public void Init()
|
|
|
|
{ /* ... */ }
|
|
|
|
|
|
|
|
[Setup] public void Prep() // Noncompliant
|
|
|
|
{ /* ... */ }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
----
|
|
|
|
|
|
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
2021-06-08 15:52:13 +02:00
|
|
|
'''
|
2021-06-08 14:23:48 +02:00
|
|
|
== Comments And Links
|
|
|
|
(visible only on this page)
|
|
|
|
|
2023-05-25 14:18:12 +02:00
|
|
|
=== on 24 Nov 2015, 14:26:17 Ann Campbell wrote:
|
|
|
|
http://www.nunit.org/index.php?p=setup&r=2.2
|
|
|
|
|
|
|
|
=== on 24 Nov 2015, 15:13:36 Ann Campbell wrote:
|
|
|
|
FYI [~tamas.vajk] I'm closing this based on your comment on MMF-124
|
|
|
|
|
2021-06-08 14:23:48 +02:00
|
|
|
endif::env-github,rspecator-view[]
|