As you can see here a very basic sample of a unit test created for a notification service on a ASP.net MVC 5 solution.
Here the code to test a failing list of emails.
[Fact]
public void ListeCourrielsEstValide_ListeInvalide_RetourneErreur()
{
//Arrange
IEnumerable<string> listeCourriels = new string[] { "123%xer;456#wer;yuio!879" };
bool valeurAttendu = false;
//Act
var resultat = notificationService.ListeCourrielsEstValide(listeCourriels);
//Assert
resultat.Should().Be(valeurAttendu);
}
No comments:
Post a Comment