-
Notifications
You must be signed in to change notification settings - Fork 0
/
Get-MACVendor.Tests.ps1
54 lines (51 loc) · 1.87 KB
/
Get-MACVendor.Tests.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Import-Module -Name ./Get-MACVendor.psm1 -Force -ErrorAction Stop
# Test inputs in various formats and responses
Describe "Get-MACVendor -MAC" {
Context "Check acceptable inputs and returned results" {
It "Allows 001223 and returns Pixim" {
Get-MACVendor -MAC 001223 | Should -Be 'Pixim'
}
It "Allows 00:12:23 and returns Pixim" {
Get-MACVendor -MAC 00:12:23 | Should -Be 'Pixim'
}
It "Allows 00-12-23 and returns Pixim" {
Get-MACVendor -MAC 00-12-23 | Should -Be 'Pixim'
}
It "Allows 001223444444 and returns Pixim" {
Get-MACVendor -MAC 001223444444 | Should -Be 'Pixim'
}
It "#3 (Bug): VMware, Inc. displayed properly" {
Get-MACVendor -MAC 005056 | Should -Be 'VMware, Inc.'
}
}
Context "Check unacceptable inputs" {
It "Does not allow 0012" {
{Get-MACVendor -MAC 0012} | Should -Throw
}
}
}
Describe "Get-MACVendor -Vendor" {
Context "Check acceptable inputs and returned results" {
It "Allows iRobot and returns one result" {
$results = Get-MACVendor -Vendor iRobot
$results | Should -Contain "1 result"
$results | Out-String | Should -BeLike "*50-14-79*"
}
It "Allows Dell and returns many results" {
$results = Get-MACVendor -Vendor Dell
$results | Out-String | Should -BeLike "*results*"
$results | Out-String | Should -BeLike "*EC-F4-BB*"
}
It "#3 (Bug): VMware, Inc. displayed properly" {
$results = Get-MACVendor -Vendor VMware
$results | Out-String | Should -BeLike "*VMware, Inc.*"
}
}
}
Describe "Get-MACVendor -Action" {
Context "Check OUI actions" {
It "Updates OUI" {
{Get-MACVendor -Action Update} | Should -Not -Throw
}
}
}