This directory contains unit tests for private (internal) JiraPS functions.
All tests in this directory follow the converter function pattern for private (internal) JiraPS functions.
Use this template for functions that:
See .template.ps1 for the standard test structure.
See ConvertTo-JiraAttachment.Unit.Tests.ps1 for a complete, working example.
Converter function tests focus on a single Describe "Behavior" block with four contexts:
Verify that:
JiraPS.Attachment)Test that:
Use data-driven tests with -TestCases for comprehensive property validation.
Verify special type handling:
JiraPS.User)Test that:
Converter tests typically:
#region DefinitionsBeforeAll in contexts to avoid redundant conversionsKeep your JSON fixtures organized:
#region Definitions
$jiraServer = 'http://jiraserver.example.com'
$sampleJson = @"
{
"id": "123",
"name": "Test Resource",
"created": "2025-01-01T00:00:00.000Z",
"author": {
"name": "JonDoe",
"displayName": "Doe, Jon"
}
}
"@
$script:sampleObject = ConvertFrom-Json -InputObject $sampleJson
#endregion Definitions
Important: Always remove personal/sensitive data from JSON fixtures.
Unlike CRUD tests in Tests/Functions/Public/: