Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusStorhaug committed Aug 18, 2024
1 parent 714fa8f commit 9112ccf
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions tests/tests/PSModuleTest.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,25 @@ Param(
Write-Verbose "Path to the module: [$Path]" -Verbose

Describe 'PSModuleTest.Tests.ps1' {
It 'Should be able to import the module' {
Import-Module -name 'PSModuleTest' -Verbose
Get-Module -name 'PSModuleTest' | Should -Not -BeNullOrEmpty
Write-Verbose (Get-Module -name 'PSModuleTest' | Out-String) -Verbose
Context 'Function: Test-PSModuleTest' {
It 'Should be able to call the function' {
Write-Verbose (Test-PSModuleTest | Out-String) -Verbose
Test-PSModuleTest | Should -Be 'Hello, World!'
}
}

Context 'Function: Get-PSModuleTest' {
It 'Should be able to call the function' {
Write-Verbose (Get-PSModuleTest | Out-String) -Verbose
Get-PSModuleTest | Should -Be 'Hello, World!'
}
}
It 'Should be able to call the function' {
Test-PSModuleTest -name 'World' | Should -Be 'Hello, World!'
Write-Verbose (Test-PSModuleTest -name 'World' | Out-String) -Verbose

Context 'Function: New-PSModuleTest' {
It 'Should be able to call the function' {
Write-Verbose (New-PSModuleTest | Out-String) -Verbose
New-PSModuleTest | Should -Be 'Hello, World!'
}
}

Context 'Variables' {
Expand Down

0 comments on commit 9112ccf

Please sign in to comment.