Tuesday, July 15, 2008

Unit testing

So for the testing framework, I will be building ontop of NUnit, an excellent "unit testing" framework.

Summary for the insulated:
Unit tests are basically automated tests which are designed to test individual "units" of an application. This is usually by declaring something called an "Assertion", basically a statement that says these and these conditions should always occur under these and these circumstances.

NUnit comes with many Assertions, but I don't think any are suitable for all of the kind of testing we are doing - fortunately NUnit can be extended with custom assertions, and that is what I am writing - a "Compatibility" assertion, which will take at least one string of PowerShell script, execute said script on any number of PowerShell (and Pash hosts), get the result (typically a collection of PSObjects) - take those results and compare the data stored within the objects with one another and ensure they are equal. If they are equal, the assertion is passed, if they are not the assertion fails (and typically the whole unit test fails).

This test will only run on Windows (since PowerShell runs on Windows), but the plan is to force the collection of unit tests to run when you want to create Release build of Pash. Should one fail, well, you are SOL. :)

Just one of the ways me and Igor are ensuring that we aren't making a competing shell, but that Pash will fundamentally be a cross platform implementation of PowerShell, and that most PowerShell scripts shall run on it without modification.

1 comment:

Anonymous said...

stop. hammer time!