Skip to content

Testing

JamieO53 edited this page Nov 15, 2017 · 2 revisions

Return to Home page

Developer Setup

Testing

Organization

Running individual test scripts from Visual Studio

  • Build

    See the build instructions

    • Build NuGetShared if necessary
    • Build the test project
  • Start or Stop NuGetShared

    The NuGetShared module contains code shared by the other projects. This can cause problems when executing test scripts. The other projects' psm1 modules import NuGetShared if necessary. Tests don't always see it if it is already imported and import it again. This causes Pester to fail in Mock. The workaround is to preload NuGetShared. It needs to be removed and imported again when it has been rebuilt.

    • Set up the PowerShell Interactive Window

      Select the PowerShell Interactive Window and enter Get-Module to to see the imported modules. Use Remove-Module to remove any of the solution's modules: NuGetShared, NuGetDebPacker and DbSolutionBuilder.

      • When testing NuGetShared

        Use Import-Module to import NuGetShared

        Import-Module .\NugetShared\bin\Debug\NuGetShared\NuGetShared.psm1

      • When testing other projects

        Use Import-Module to import NuGetShared first then the module being tested

        Import-Module .\NugetShared\bin\Debug\NuGetShared\NuGetShared.psd1

        Import-Module .\DbSolutionBuilder\bin\Debug\DbSolutionBuilder\DbSolutionBuilder.psm1

Clone this wiki locally