`var y = homer.Salary / denominator;`
should not throw but threw
System.DivideByZeroException
with message
"Attempted to divide by zero."
ShouldNotThrow Action Extension
var homer =newPerson { Name ="Homer", Salary =30000 };var denominator =0;var action = () => {var y =homer.Salary/ denominator; };action.ShouldNotThrow();
`var task = Task.Factory.StartNew( () => { var y = homer.Salary / denominator; }); return task;`
should not throw but threw
System.DivideByZeroException
with message
"Attempted to divide by zero."