Tomcanter/unit test scaffold - #2
Open
tcanter wants to merge 4 commits into
Open
Conversation
Refactor and harden the installer behavior introduced in the CU6 rewrite, with focus on PowerShell-native safety patterns, clearer UX, and reliable failure handling. - Simplify script help metadata by condensing SYNOPSIS/DESCRIPTION into concise, user-facing guidance. - Align execution semantics with standard PowerShell behavior via CmdletBinding(SupportsShouldProcess) and proper WhatIf/Confirm handling. - Correct ForceInstall behavior so prerequisite work (including folder setup) still runs when ForceInstall is specified. - Add early elevation guardrails to fail fast on non-admin ForceInstall before download/copy work begins. - Fix output signaling so error messages render in red and improve ForceInstall-specific messaging. - Improve reliability of install operations by replacing Invoke-Expression with the native call operator and wrapping copy operations in try/catch with -ErrorAction Stop. - Improve terminal outcome reporting by distinguishing prerequisite failures from runtime installation failures. - Harden CU detection against uninstall DisplayName variation by using normalized regex matching for BizTalk version and KB/CU markers, while preserving KB-first certainty for mapping.
Extract Resolve-WinSCPPackageLayout into testable core module. Add basic Pester test suite demonstrating mocking patterns for file system operations. Include testing guide for running and extending test suite.
Add Test Suite section listing current tests (Resolve-WinSCPPackageLayout) and planned tests (CU detection, admin checks, install flow). Provides quick reference for test coverage and development roadmap.
Finalize Stage 1 unit testing scaffold by hardening the extracted core function and test suite. Add parameter validation for required inputs, adopt Pester 5 assertion syntax, add a clear Pester 5+ version gate, and document intentional compatibility paths for historical WinSCP package layouts. Also include repository .gitignore updates and test-suite documentation updates for ongoing test inventory and roadmap.
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.
Summary
Finalize Stage 1 unit testing scaffold for BizTalk WinSCP installer code.
What this PR adds
Resolve-WinSCPPackageLayoutinsrc/InstallWinSCPForBizTalk.Core.psm1tests/Unit/Resolve-WinSCPPackageLayout.Tests.ps1tests/README.md.gitignoreTest hardening and compatibility updates
Mandatory+ValidateNotNullOrEmptyShould -Be,Should -Match, etc.)lib/netstandard2.0,lib/netstandard,lib/net,libValidation
Notes for reviewers