Files
PowerShell-PowerShell/test/powershell/Language/Interop/DotNet/DotNetAPI.Tests.ps1
T
James Truher 1e1c4b7dc0 Restructure of pester test layout
This restructuring moves tests to a directory name which matches the module
in which the cmdlet resides which should improve the discoverability of a
specific test.
For tests which are not about cmdlets in a module, new directories have been
created to make those tests easier to find as well
2016-06-29 12:05:41 -07:00

26 lines
766 B
PowerShell

Describe "DotNetAPI" {
$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"
}
}