Community Page
- paulmwatson.com/journal Jump to website »
-
Subscribe -
Community
-
Top Commenters
-
Popular Threads
-
Recent Comments
- Make songbird look like spotify: http://addons.songbirdnest.com/addon/1440
- Got it, thanks Paul!
- Email me your email address so I can invite you Mike (paul@paulmwatson.com)
- Happy New Year to you, as well! I was stopping by to see if you would be willing to lend a reader a Spotify invitation. I am desperately hoping to be able try out the service. Thanks! Mike
- Nice one Jamie. Even more ironic is that that "mass production" is probably still underpaid, underage workers in some 3rd world country sweat-shop.
Jump to original thread »
I have just been taught the lesson that when testing your code, test for failures too.
Take a method that removes a record from the database. You pass in the Id of the record and it DELETEs it. Initially I tested for an invalid Id (e.g. -1) and for a successful delete. I never tested to [. ... Continue reading »
Take a method that removes a record from the database. You pass in the Id of the record and it DELETEs it. Initially I tested for an invalid Id (e.g. -1) and for a successful delete. I never tested to [. ... Continue reading »
3 years ago
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?
3 years ago
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.