RepeatAttribute
RepeatAttribute may be applied to test case in order
to run it multiple times.
using NUnit.Framework.Interfaces;
using NUnit.Framework.Internal.Commands;
using System;
namespace NUnit.Framework
{
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
public class RepeatAttribute : PropertyAttribute, IWrapSetUpTearDown, ICommandWrapper
{
private int _count;
public RepeatAttribute(int count)
: base(count)
{
_count = count;
}
public TestCommand Wrap(TestCommand command)
{
return new RepeatedTestCommand(command, _count);
}
}
}