A few astute readers have already found a couple issues and sent in a few ideas.  I've updated the calculator sample, both the live version and the code download.

Included in the update:

  • A few bug fixes
  • Larger toolbar buttons (some folks didn't notice them at first)
  • I've added a Unit Test project and some unit tests.
  • A new skin has been added (the style shamelessly stolen from Corrina's blog, but she's on vacation so I don't feel too bad about it :)
    • sketchy

Adding Unit Tests

If you're interested in knowing more about the Unit Test framework and getting it up and running, see Jeff Wilcox's blog on getting the bits and some VS templates.

I implemented my calculator in several layers, separated by interface definitions as shown here:


This allowed me to accomplish 2 things.  First, the skinning I wanted and second the ability to isolate the individual parts of my application for testing.  So if you look at the test project that I've added to the code zip, you'll see that there are tests that isolate just the commands themselves, tests for just the numeric stack itself and tests that work on the engine in isolation (not I did not do full test coverage, just a smattering of samples).  Still working on figuring out how one would test the skin in isolation (we need a good UI automation package for Silverlight! :)