Search code examples
c#unit-testingauto-update

How To Unit Test An Application Updater


How would you Unit Test the update process of an application?

I have an application and now I'm writing my own Update module for it (using MVVM) which is a separate EXE. What is the best way to structure this module so that it will be possible to unit test.


Solution

  • Very interesting question. I am also working on an update application at the moment - I'm using the Microsoft Updater Application Block to allow the application to download updates over http and update itself.

    I have designed my application using an Interface-based programming approach to allow me to easily mock implementations to help in unit testing. There's also some very good mocking frameworks available. https://stackoverflow.com/questions/37359/what-c-mocking-framework-to-use

    In terms of testing downloading an update, installing it, testing versioning etc. I think a Test Harness might be more appropriate than Unit Tests?