Freigeben über


Bookmark Collection: Current progress

When I was thinking about the next test to write I had to go back and look at the test list again. If I can't keep the thing in my head how hard must it be for everyone else? The purpose of this entry is to identify what has been completed so far and modify the list based on feedback from the implementation. The following is the updated list, strike-through indicates that the test is completed and the hyper-link will take you to the entry where the test and corresponding implementation is described:

  • Count == 0 Click Here
  • Add a Bookmark (label, URL), Count == 1 Click Here
  • Add a Bookmark, remove a Bookmark, Count == 0 Click Here
  • Initial: Remove a Bookmark, expect InvalidOperationException, Current: Removed a Bookmark, verify that it has been removed - This test has been modified because of the excellent points made by David M and Thomas Eyde who pointed out that the point of remove is to get it out of the collection. Thanks for the feedback.
  • Add 2 Bookmarks, remove a Bookmark, Count == 1 Click Here
  • Add a Bookmark, Retrieve using the label Click Here
  • Add 2 Bookmarks, Retrieve each by label
  • Add a Bookmark with a null label, expect ArgumentNullException - This is discussed in the next entry
  • Add a Bookmark with a null URL, expect ArgumentNullException - This is discussed in the next entry
  • Add a Bookmark, add another with the same label, expect ArgumentException
  • Retrieve a Bookmark that is not in the collection, return null Click Here
  • Add a Bookmark, replace the URL with an Item property, verify that the Bookmark has been updated
  • Add a Bookmark, Contains() returns true
  • Contains() returns false
  • Add 2 Bookmarks, call Clear(), Count == 0
  • Add 3 Bookmarks, call GetEnumerator and verify that the 3 Bookmarks are enumerated
  • Add 3 Bookmarks, Call Keys, verify that all 3 labels are returned
  • Add 3 Bookmarks, Call Values, verify that all 3 URLs are returned

That's the list so far.