Skip to content

Commit 81965d4

Browse files
committed
Add unit test
1 parent 4d50fee commit 81965d4

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
$script:dscModuleName = 'FailoverClusterDsc'
2+
$script:subModuleName = 'FailoverClusterDsc.Common'
3+
4+
$script:parentModule = Get-Module -Name $script:dscModuleName -ListAvailable | Select-Object -First 1
5+
$script:subModulesFolder = Join-Path -Path $script:parentModule.ModuleBase -ChildPath 'Modules'
6+
7+
$script:subModulePath = Join-Path -Path $script:subModulesFolder -ChildPath $script:subModuleName
8+
9+
Import-Module -Name $script:subModulePath -Force -ErrorAction 'Stop'
10+
11+
Describe 'FailoverClusterDsc.Common\Convert-DistinguishedNameToSimpleName' -Tag 'Convert-DistinguishedNameToSimpleName' {
12+
Context 'When passing a distinguished name' {
13+
It 'Should return the expected cluster name' {
14+
Convert-DistinguishedNameToSimpleName -DistinguishedName 'CN=CLUSTER1,OU=BUSINESS,DC=RANDOM,DC=LOCAL' |
15+
Should -Be 'CLUSTER1'
16+
}
17+
}
18+
19+
Context 'When passing a cluster name' {
20+
It 'Should return the expected cluster name' {
21+
Convert-DistinguishedNameToSimpleName -DistinguishedName 'CLUSTER2' |
22+
Should -Be 'CLUSTER2'
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)