This commit is contained in:
OCram85 2022-06-28 10:44:52 +02:00
parent c3ac2d2fc9
commit eb791af722
3 changed files with 26 additions and 16 deletions

View File

@ -4,7 +4,7 @@ BeforeAll {
}
Describe "New-CSCertAttribute" {
Context "Basis Tests" {
Context "Basis Tests" -Tag 'Unit' {
It "Should not throw" {
$AttribParams = @{
Country = 'DE'

View File

@ -0,0 +1,25 @@
BeforeAll {
$ManifestFile = (Get-Item -Path "./src/*.psd1").FullName
Import-Module $ManifestFile -Force
}
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 = @{
CRTAttribute = $attribs
KeyName = Join-Path -Path (Get-TempDir) -ChildPath '/foo.key'
CertName = Join-Path -Path (Get-TempDir) -ChildPath '/cert.pfx'
}
{ New-CSCertificate @CertAttribs } | Should -Not -Throw
}
}
}

View File

@ -1,15 +0,0 @@
Describe "New-CSCertificate" {
Context "Basic Tests" {
It "Test1: Should not throw" {
$attribs = New-CSCertAttribute -Country 'DE' -State 'BW' -City 'KA' -Organization 'IT' -OrganizationalUnitName'' -CommonName 'Mycert'
$CertAttribs = @{
CRTAttribute = $attribs
KeyName = Join-Path -Path (Get-TempDir) -ChildPath '/foo.key'
CertName = Join-Path -Path (Get-TempDir) -ChildPath '/cert.pfx'
}
{ New-CSCertificate @CertAttribs } | Should -Not -Throw
}
}
}