Skip to content

About

A library of PowerShell functions that gives testers complete control over the meaning of their assertions. Well, at least that's the goal.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

PowerShell Assert Library

A library of PowerShell functions that gives testers complete control over the meaning of their assertions.

Well, at least that’s the goal.

Where do I begin?

You can run the script
 .\Release\Script\AssertLibrary.ps1
or you can import the module
 Import-Module .\Release\Module\AssertLibrary

What do I need?

You need PowerShell version 2 or higher.

Include 1 of the following in your scripts or module if you want to use these functions in your automated tests
  • "Release\Module\AssertLibrary\" module directory.

  • "Release\Script\AssertLibrary.ps1" script file

    Note

    The "Release\Script\" directory has multiple script files.

    The only difference between these script files is the language used to write the documentation. For example, "AssertLibrary_en-US.ps1" contains documentation written for people who speak English in the US.

    You only need 1 of these files.

What kinds of things can I do with these functions?

Online, see the following link

https://github.com/imfrancisd/PowerShell-Assert-Library/blob/master/docs/README.txt

In PowerShell, if you imported the module, you can get an overview of the available functions using this command
 get-help about_assertlibrary

Can I use these functions in PowerShell testing frameworks?

Yes.

In fact, the functions were designed so that they can be used in different PowerShell testing frameworks. For example, if you need to rename one of the functions (because the name of the function conflicts with another function in the testing framework) then renaming that function won’t break the other functions.

Can I use these functions without any frameworks?

Yes.

You can even use these functions directly in the shell.

What are the names of the functions?

Online, see the following link

https://github.com/imfrancisd/PowerShell-Assert-Library/blob/master/docs

In PowerShell, you can find the names of the functions with this command
 (get-module assertlibrary*).exportedfunctions.keys

How do I use the functions?

Online, see the following link

https://github.com/imfrancisd/PowerShell-Assert-Library/blob/master/docs

In PowerShell, you can view the help file for each function using PowerShell’s Get-Help cmdlet.
 # this will display the help file for Group-ListItem
 Get-Help Group-ListItem -Full

The help file contains detailed information about the function as well as examples of how to use the function.

About

A library of PowerShell functions that gives testers complete control over the meaning of their assertions. Well, at least that's the goal.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages