Skip to content

Commit 0b37219

Browse files
committed
Refreshing
1 parent 2f39c36 commit 0b37219

File tree

6 files changed

+53
-0
lines changed

6 files changed

+53
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Describe 'Test-ParamSets Basic Tests' {
2+
It 'Runs with Name parameter set' {
3+
{ Test-ParamSets -Name 'John' -Surname 'Doe' -Decimal } | Should -Not -Throw
4+
}
5+
6+
It 'Runs with ID parameter set' {
7+
{ Test-ParamSets -ID '1234' -Hexidecimal } | Should -Not -Throw
8+
}
9+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#WIP
2+
<#
3+
Describe 'Test-ParamSets Detailed Tests' {
4+
Context 'Validates Name Parameter Set' {
5+
It 'Outputs correct parameter set name' {
6+
$result = Test-ParamSets -Name 'John' -Surname 'Doe' -Decimal
7+
$result | Should -Contain 'Set name is: Name'
8+
}
9+
10+
It 'Validates output with Name and Surname' {
11+
$result = Test-ParamSets -Name 'John' -Surname 'Doe' -Decimal
12+
$result | Should -Contain 'Name is: [John], ID is []'
13+
}
14+
15+
It 'Detects Name parameter set with Verbose logging' {
16+
$result = & { Test-ParamSets -Name 'John' -Surname 'Doe' -Decimal -Verbose } 4>&1
17+
$result | Should -Match 'IF detected Name'
18+
}
19+
}
20+
21+
Context 'Validates ID Parameter Set' {
22+
It 'Outputs correct parameter set name' {
23+
$result = Test-ParamSets -ID '1234' -Hexidecimal
24+
$result | Should -Contain 'Set name is: ID'
25+
}
26+
27+
It 'Validates output with ID and empty Name' {
28+
$result = Test-ParamSets -ID '1234' -Hexidecimal
29+
$result | Should -Contain 'Name is: [], ID is [1234]'
30+
}
31+
32+
It 'Detects ID parameter set with Verbose logging' {
33+
$result = & { Test-ParamSets -ID '1234' -Hexidecimal -Verbose } 4>&1
34+
$result | Should -Match 'IF detected ID'
35+
}
36+
}
37+
38+
Context 'Invalid Parameter Combinations' {
39+
It 'Throws error when Name and ID are used together' {
40+
{ Test-ParamSets -Name 'John' -ID '1234' } | Should -Throw -ErrorMessage "Cannot use both 'Name' and 'ID' parameters together."
41+
}
42+
}
43+
}
44+
#>

0 commit comments

Comments
 (0)