2022-06-28 10:44:52 +02:00
|
|
|
BeforeAll {
|
|
|
|
$ManifestFile = (Get-Item -Path "./src/*.psd1").FullName
|
|
|
|
Import-Module $ManifestFile -Force
|
2022-06-28 11:05:19 +02:00
|
|
|
|
|
|
|
$PrivateFunctions = (Get-ChildItem -Path "./src/Private/*.ps1" | Where-Object {
|
|
|
|
$_.BaseName -notmatch '.Tests'
|
|
|
|
}
|
|
|
|
).FullName
|
|
|
|
foreach ( $func in $PrivateFunctions) {
|
|
|
|
. $func
|
|
|
|
}
|
2022-06-28 10:44:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Describe "New-CSCertificate" {
|
|
|
|
Context "Basic Tests" -Tag 'Unit' {
|
|
|
|
It "Should not throw" {
|
|
|
|
$attribs = @{
|
|
|
|
Country = 'DE'
|
|
|
|
State = 'BW'
|
|
|
|
City = 'KA'
|
|
|
|
Organization = 'IT'
|
|
|
|
OrganizationalUnitName = 'foo'
|
|
|
|
CommonName = 'MyCert'
|
|
|
|
}
|
|
|
|
$CertAttribs = @{
|
2022-06-28 11:19:57 +02:00
|
|
|
CRTAttribute = New-CSCertAttribute @attribs
|
2022-06-28 10:44:52 +02:00
|
|
|
KeyName = Join-Path -Path (Get-TempDir) -ChildPath '/foo.key'
|
|
|
|
CertName = Join-Path -Path (Get-TempDir) -ChildPath '/cert.pfx'
|
|
|
|
}
|
|
|
|
{ New-CSCertificate @CertAttribs } | Should -Not -Throw
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|