lundi 7 décembre 2020

How can I make my method go to the assertions or an if condition when it repeats the second time?

I am using Nunit and using the repeat attribute to run my test twice. Its a negative test and it should not pass the second time it runs.. How can I handle this so my assertion or my conditional statementis checked only the second my it repeats.

[Test]
[Repeat(2)]
public void RunTwiceWithSameId()
{
     response = HttpPost()
      
     //so when it runs second time it should fail with 400 bad request and I want to catch that
} 

Aucun commentaire:

Enregistrer un commentaire