Test to see that main currently fails#92
Closed
Marius Storhaug (MariusStorhaug) wants to merge 1 commit into
Closed
Test to see that main currently fails#92Marius Storhaug (MariusStorhaug) wants to merge 1 commit into
Marius Storhaug (MariusStorhaug) wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds comprehensive test cases for Get-Context and Get-ContextInfo to verify handling of various ID inputs.
- Introduce tests for
Get-Context -IDwith arrays, single IDs, nonexistent, mixed valid/invalid, whitespace, and null values - Add multiple-ID scenarios for
Get-ContextInfo -IDin VaultA
Comments suppressed due to low confidence (2)
tests/Context.Tests.ps1:342
- Test description is missing the function name and ID parameter context. Rename to "Get-ContextInfo -ID array - Should return only specified contexts in VaultA" for consistency.
It 'Should return only specified contexts for multiple IDs in VaultA' {
tests/Context.Tests.ps1:342
- Consider adding tests for Get-ContextInfo covering single ID retrieval, non-existent ID, mixed valid/invalid IDs, and whitespace inputs to mirror the coverage in Get-Context tests.
It 'Should return only specified contexts for multiple IDs in VaultA' {
Comment on lines
+210
to
+212
| It 'Get-Context -ID with whitespace or null - Should not have output leakage (returns nothing)' { | ||
| $results = Get-Context -ID ' ' -Vault 'VaultA' | ||
| $results | Should -BeNullOrEmpty |
There was a problem hiding this comment.
[nitpick] This test covers both whitespace and $null IDs in one block, which may hide failures; consider splitting into separate tests for whitespace-only and null inputs for clearer failure isolation.
Suggested change
| It 'Get-Context -ID with whitespace or null - Should not have output leakage (returns nothing)' { | |
| $results = Get-Context -ID ' ' -Vault 'VaultA' | |
| $results | Should -BeNullOrEmpty | |
| It 'Get-Context -ID with whitespace - Should not have output leakage (returns nothing)' { | |
| $results = Get-Context -ID ' ' -Vault 'VaultA' | |
| $results | Should -BeNullOrEmpty | |
| } | |
| It 'Get-Context -ID with null - Should not have output leakage (returns nothing)' { |
| It 'Get-Context -ID single (nonexistent) - Should not have output leakage (returns nothing)' { | ||
| $id = 'NonExistentContext' | ||
| $results = Get-Context -ID $id -Vault 'VaultA' | ||
| $results | Should -BeNullOrEmpty |
There was a problem hiding this comment.
[nitpick] When validating that a collection is empty, consider using Should -BeEmpty for clarity and specificity rather than Should -BeNullOrEmpty.
Suggested change
| $results | Should -BeNullOrEmpty | |
| $results | Should -BeEmpty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ation
Description
Type of change
Checklist