In this small piece of code:
public event StabilityChangedHandler StabilityChanged;
267 private void RaiseStabilityChanged()
{
if (StabilityChanged != null)
{
1 StabilityChanged();
}
275 }
NCover reports only 50% branch coverage for this Method. However, I know that I RaiseStabilityChanged() is being called with and without handlers being hooked up to the StabilityChangedEvent. On the left I put the hit counts reported by NCover.
Why might NCover be reporting 50% instead of 100%?
It appears that no test is ever run where StabilityChanged == null. Probably not an important test to run, but it will get your coverage to 100%