Skip to content
This repository has been archived by the owner on May 31, 2023. It is now read-only.
Ronald Rink edited this page Jul 6, 2016 · 12 revisions

biz.dfch.PS.Pester.Assertions

The biz.dch.PS.Pester.Assertions PowerShell module is an add-on to Pester and defines custom assertions you can use in your regular Pester scripts.

For a brief description on how to create custom assertions have a look at Extending Pester for fun and profit.

Usage

You can install this module as any other regular PowerShell module. Pester will automatically load and detect the module, so you can use the assertions as described in the examples and wiki. Have a look at the tests as well to see the assertions in action.

As we at d-fens use this module along with our other PowerShell modules it has some dependencies, such as:

You can easily modify and remove the dependencies if you prefer to have a stand-alone version.

Note

Currently the Pester Not operator will NOT work with the ThrowException assertion as the logic in Pester does not seem to handle a not aoccurring exception and the Pester defined message templates cannot handle that.

Have a look at the test ThrowExceptionWithoutExceptionShouldSucceedButActuallyFails to see such a scenario.

Assertions

Clone this wiki locally