-
Notifications
You must be signed in to change notification settings - Fork 60
Negative Test with Exception
Yaron Weiss edited this page Aug 9, 2018
·
1 revision
Usage for methods which might return exception based on condition of input params (non GingerAction method)
[TestMethod]
[ExpectedException(typeof(System.DivideByZeroException))]
public void DivideMethodTest()
{
DivideClass.DivideMethod(0);
}
[GingerAction("ReadExcelCell", "Read From Excel")]
public void ReadExcelCell(ref GingerAction GA, string FileName, string sheetName, string row, string column)
{
if (!FileExist(filePath))
{
GA.AddError("File not found at: " + filePath);
}
// ...
}
Spice it Up!