From eb791af722549e9bc13dcf67cb3f20e1db26b9ad Mon Sep 17 00:00:00 2001 From: OCram85 Date: Tue, 28 Jun 2022 10:44:52 +0200 Subject: [PATCH] wip --- src/Certificate/New-CSCertAttribute.Tests.ps1 | 2 +- src/Certificate/New-CSCertificate.Tests.ps1 | 25 +++++++++++++++++++ .../51_New-CSCertificate.Tests.ps1 | 15 ----------- 3 files changed, 26 insertions(+), 16 deletions(-) create mode 100644 src/Certificate/New-CSCertificate.Tests.ps1 delete mode 100644 tests/Certificate/51_New-CSCertificate.Tests.ps1 diff --git a/src/Certificate/New-CSCertAttribute.Tests.ps1 b/src/Certificate/New-CSCertAttribute.Tests.ps1 index db7a805..50a966a 100644 --- a/src/Certificate/New-CSCertAttribute.Tests.ps1 +++ b/src/Certificate/New-CSCertAttribute.Tests.ps1 @@ -4,7 +4,7 @@ BeforeAll { } Describe "New-CSCertAttribute" { - Context "Basis Tests" { + Context "Basis Tests" -Tag 'Unit' { It "Should not throw" { $AttribParams = @{ Country = 'DE' diff --git a/src/Certificate/New-CSCertificate.Tests.ps1 b/src/Certificate/New-CSCertificate.Tests.ps1 new file mode 100644 index 0000000..c02d0c9 --- /dev/null +++ b/src/Certificate/New-CSCertificate.Tests.ps1 @@ -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 + } + } +} diff --git a/tests/Certificate/51_New-CSCertificate.Tests.ps1 b/tests/Certificate/51_New-CSCertificate.Tests.ps1 deleted file mode 100644 index aac7f74..0000000 --- a/tests/Certificate/51_New-CSCertificate.Tests.ps1 +++ /dev/null @@ -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 - } - } -}