This summer I'm taking a vacation to Croatia and I wanted a simple PocketPC
app that will convert between the Euro, the Croatian kuna , and my national
currency the Romanian Leu.
Obviously I first searched for such an app and I
did found one - unfortunately id had everything I wanted BUT the Croatian kuna
:). So , without too much thinking I decided to write the app myself (small
syndrome of not invented here :) ). So, I set about creating my own application.
The most important part(at least from a programmers point of view) , and the
one that I really wanted to get right was the CurrencyCalculator that would
convert from a currency to another currency and the Money class that would
represent a specific Currency.
I'm not exactly proficient with
TestDrivenDevelopment and thought this would make a grate candidate for TDD.
You'll find 2 (yes two :) ) tests in the CurrencyCalculator.Tests project.
These are the only tests in the application for the moment , I'll write a few
more for some other stuff (like downloading an xml with exchange rates ) but the
rest is pretty much UI stuff which I'm not gonna test.
Another interesting part of the project is the Dependency
Injection part - where I only wanted to be able to do some
constructor injection and be able to specify LifeStyle (Transient or Singleton)
for different classes . It's surprising how little choice you have for the
mobile platform, even for simple stuff.
But I'll talk more about this in another post.
The project is Open Source, and you can grab the code from google code : Currency Calculator for
PocketPC.