PowerShell/docs/cmdlet-example/SendGreeting.Tests.ps1

14 lines
582 B
PowerShell
Raw Normal View History

2016-05-19 23:28:50 +02:00
Describe "Send-Greeting cmdlet" -Tag 'Slow' {
2016-05-04 19:25:04 +02:00
It "Should be able build the cmdlet" {
Remove-Item -Recurse -Force bin -ErrorAction SilentlyContinue
dotnet restore --verbosity Error | Should BeNullOrEmpty
dotnet build | ?{ $_ -match "Compiling SendGreeting for .NETStandard,Version=v1.3" } | Should Not BeNullOrEmpty
2016-05-04 19:25:04 +02:00
}
It "Should be able to use the module" {
Import-Module -ErrorAction Stop ./bin/Debug/netstandard1.3/SendGreeting.dll
2016-05-04 19:25:04 +02:00
Send-Greeting -Name World | Should Be "Hello World!"
Remove-Module SendGreeting
}
}