-
Notifications
You must be signed in to change notification settings - Fork 5
7. Exception handel
Kamruzzaman edited this page Nov 13, 2019
·
1 revision
//Example 1:-
[ExpectedException(typeof(ArgumentException))] //<---
public void NumberOfFruits_NegativeValue_Exception(int person, int expected)
{
//Act
var original = manual.NumberOfFruits(person);
//Assert
Assert.AreEqual(original, expected);
}
//Example 2:-
//Act
try
{
var original = manual.NumberOfFruits(person);
}
catch (ArgumentException)
{
// The test succeeded
}