From 9d6fdea9d26f10a6930c457f9d5401c66adaceef Mon Sep 17 00:00:00 2001 From: OCram85 Date: Fri, 5 Apr 2019 13:31:30 +0200 Subject: [PATCH] add basic cert pester pests --- .../Certificate/01_New-CSCertAttribute.Tests.ps1 | 7 +++++++ tests/Certificate/02_New-CSCertificate.Tests.ps1 | 15 +++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 tests/Certificate/01_New-CSCertAttribute.Tests.ps1 create mode 100644 tests/Certificate/02_New-CSCertificate.Tests.ps1 diff --git a/tests/Certificate/01_New-CSCertAttribute.Tests.ps1 b/tests/Certificate/01_New-CSCertAttribute.Tests.ps1 new file mode 100644 index 0000000..e6f5cb4 --- /dev/null +++ b/tests/Certificate/01_New-CSCertAttribute.Tests.ps1 @@ -0,0 +1,7 @@ +Describe "New-CSCertAttribute" { + Context "Basis Tests" { + It "Test1: Should not throw " { + { New-CSCertAttribute -Country 'DE' -State 'BW' -City 'KA' -Organization 'IT' -OrganizationalUnitName'' -CommonName 'Mycert' } | Should -Not -Throw + } + } +} diff --git a/tests/Certificate/02_New-CSCertificate.Tests.ps1 b/tests/Certificate/02_New-CSCertificate.Tests.ps1 new file mode 100644 index 0000000..aac7f74 --- /dev/null +++ b/tests/Certificate/02_New-CSCertificate.Tests.ps1 @@ -0,0 +1,15 @@ +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 + } + } +}