Posts Tagged Unit Testing

Workaround for unit testing code that reside in the GAC

The problem I expressed my frustration the other day on twitter when it comes to unit testing and code that reside in GAC (global assembly cache). This problem may occur more often in frameworks that like to put their code in the GAC, like SharePoint for example. Let’s examine this with an example: Imagine the […]

, ,


Pester: How to unit test your PowerShell modules

I’ve written about Pester before on how & why you should really start testing your PowerShell code. However, obstacles may arise when you want to write unit tests for PowerShell modules. In this post I’m going to present a solution that enables you to overcome some of these obstacles. Let’s get started. Problem Let’s take the […]


1 Comment

Pester: Unit Testing for PowerShell

Pester is a BDD inspired testing framework for PowerShell just like Jasmine is on the JavaScript side and RSpec is on the Ruby side for example (I do believe that JavaScript is one of the best comparisons for PowerShell though, it being a scripting language and all). This blog post is meant as a quick […]

, , , ,


ExpandoObject: exposing properties to the TypeDescriptor

Consider the following unit test: I’ve highlighted the interesting parts which are: creating an ExpandoObject with two properties (Foo and Bar) using TypeDescriptor.GetProperties to fetch them There should be two properties but sadly this unit test returns: The problem is that the ExpandoObject, internally, uses a dictionary of string and object (IDictionary<string,object>) to store the […]

, , , , ,

1 Comment