forked from PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDotNetAPI.Tests.ps1
More file actions
25 lines (19 loc) · 777 Bytes
/
Copy pathDotNetAPI.Tests.ps1
File metadata and controls
25 lines (19 loc) · 777 Bytes
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
Describe "DotNetAPI" -Tags "CI" {
$posh_E = 2.718281828459045
$posh_pi = 3.14159265358979
It "Should be able to use static .NET classes and get a constant" {
[System.Math]::E | Should Match $posh_E.ToString()
[System.Math]::PI | Should Match $posh_pi.ToString()
}
It "Should be able to invoke a method" {
[System.Environment]::GetEnvironmentVariable("PATH") | Should Be $env:PATH
}
It "Should not require 'system' in front of static classes" {
[Environment]::CommandLine | Should Be ([System.Environment]::CommandLine)
[Math]::E | Should Be ([System.Math]::E)
}
It "Should be able to create a new instance of a .Net object" {
[System.Guid]$guidVal = [System.Guid]::NewGuid()
$guidVal.GetType().Name | Should Be "Guid"
}
}