I'm converting a webtest that loops 100 times (fires the request and validates the response 100 times) to NUnit. It seems that the [Repeat]
attribute only works for [Test]
, not [TestCase]
or any other decoration/attribute. What is the cleanest way to do this? I want to fire that one test case with those parameters 100 times, and I'd like to do it without adding a loopCount
parameter to my test case and nesting my act and assert sections in a for loop.
The below code only runs once.
[TestCase("arg1", "arg2"), Repeat(100)]
public void testing(string arg1, string arg2)
{
//Arrange
//Act
var response = RequestSender.SendGetRequest();
//Assert
AssertStuff(arg1, arg2);
}