DISQUS

Life is grand: Testing both ways

  • Steve Crane · 3 years ago
    You make a good point but your example raises an interesting question.

    If you request deletion of ID n then the successful result is that the row with ID n no longer exists after the operation. This is the case if ID n did not exist in the first place so can it really be said to be an error if a non-existent item is deleted?
  • Paul Watson · 3 years ago
    Good point Steve.

    I think though throwing an exception when no rows were affected gives better information to the caller than just silently continuining as if a row was affected. The caller can then choose what to do with that info.