i have this method in my data access class and i have a unit test to make sure it does work properly, but my test doesn't test the exception so my question is should i create a new test to force the exception to be raised or should i just trust that the catch block will work just fine in case of an exception ? is it worth the effort ?
here is an example :
public void UpdateProject(Project project)
{
using (var transaction = _session.BeginTransaction())
{
try
{
_session.Update(project);
_session.Flush();
transaction.Commit();
}
catch (HibernateException)
{
transaction.Rollback();
throw;
}
}
}