Encuentre excepciones no detectadas en el código C #
Me pregunto si hay una herramienta para encontrar excepciones no detectadas en C # usando análisis de código estático. Básicamente quiero seleccionar un método A () y quiero una lista de todas las excepciones lanzadas por el método A () y todos los métodos llamados por el método A (). Lo intenté ReSharper + Agent Johnson y AtomineerUtils, ambos fallan en esta sencilla tarea.
Aquí está mi código de ejemplo:
public class Rectangle
{
public int Width { get; set; }
public int Height { get; set; }
public int Area()
{
CheckProperties();
long x = Width * Height;
if (x > 10)
throw new ArgumentOutOfRangeException();
return (int) x;
}
private void CheckProperties()
{
if (Width < 0 || Height < 0)
throw new InvalidOperationException();
}
}
La herramienta debería poder decirme (en cualquier forma) que método Area () arrojaráArgumentOutOfRangeException
oInvalidOperationException.