In a previous post I wrote about changing the interface that the Bookmarks class would implement from IDictionary to ICollection<Bookmark>. In order to do this I want to look at the test list and see if there are any new tests or tests that we had planned on that are no longer needed. Here is the updated test list:
The first step is to walk through the interface changes. Let's do that one test at a time starting at the first test. The easiest way to do this is to comment out all the tests or use [Ignore] it's up to you. Once they are commented out uncomment each one individually, modify the test, see if the test passes, if not modify the code to make the test pass. After doing this the Bookmarks class looks like this:
using
public
public bool Contains(Bookmark item) { throw new Exception("The method or operation is not implemented."); }
// the remaining methods are implemented the same way as // Contains until tests are written}
That was fairly straight forward. A note to self; next time I implement a class that inherits from an interface I need to make sure the class implements the interface right from the start and just have each unimplemented method throw an exception. That way the tests conform to the interface right from the start. To summarize all the tests have been updated and the Bookmarks class now implements ICollection<Bookmark>; the major refactoring is now complete. The following is the test list with the appropriate tests checked off:
The next step will be to implement the Contains method. Until next time...