Skip to content

Missing unit tests #31

@devblackops

Description

@devblackops

In order to test and maintain the quality of this module, unit tests for all functions should be created. We already have tests for meta information such as comment-based help, the module manifest, and text encoding. In the dev branch, I've reorganized the Tests folder a bit to hopefully help manage all the various tests.

There is a commented out test script at Tests/meta/Function.Coverage.tests.ps1 that is intended to verify that all files under NetScaler/Public and NetScaler/Private have a matching test script in Tests/unit/public/ or Tests/unit/private/ respectively. I've leaving this commented out for now to keep the build from failing until the various tests are created. It will probably be awhile until all the tests are written and that is OK.

Since this module relies so heavily on an external endpoint (NetScaler), I imagine the unit tests will have extensive use of mocking. I created a folder at Tests/unit/mocks to hold mock objects that can be reused amongst the tests.

I'm not entirely sure this is the best approach to managing the tests and I'm open to alternative approaches to managing the structure. I just thought I'd throw this out there.

Expected Behavior

Create a Pester unit test file under Tests/unit/public/<function-name>.tests.ps1 for all publicly exposed functions and a unit test file under Tests/unit/private/<function-name>.tests.ps1 for private ones.

Current Behavior

Missing unit tests for all functions.

Possible Solution

Create a Pester test file for each public/private function.

Context

Improve the quality of the module.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions