mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
changes tags for tests
Start using tags CI, Feature, Scenario
This commit is contained in:
1 parent
1349372b39
commit
9e225ccae2
145 files changed
+248
-248
No files matched your search
@@ -1,4 +1,4 @@
|
||||
Describe 'Get-CimClass' {
|
||||
Describe 'Get-CimClass' -tags "CI" {
|
||||
# Get-CimClass works only on windows
|
||||
It 'can get CIM_Error CIM class' -Skip:(-not $IsWindows) {
|
||||
Get-CimClass -ClassName CIM_Error | Should Not Be $null
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Import-Module" {
|
||||
Describe "Import-Module" -Tags "CI" {
|
||||
$moduleName = "Microsoft.PowerShell.Security"
|
||||
|
||||
BeforeEach {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Remove-Module" {
|
||||
Describe "Remove-Module" -Tags "CI" {
|
||||
$moduleName = "Microsoft.PowerShell.Security"
|
||||
|
||||
BeforeEach {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Set-PSDebug" {
|
||||
Describe "Set-PSDebug" -Tags "CI" {
|
||||
Context "Tracing can be used" {
|
||||
AfterEach {
|
||||
Set-PSDebug -Off
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe 'Get-WinEvent' {
|
||||
Describe 'Get-WinEvent' -Tags "CI" {
|
||||
|
||||
# Get-WinEvent works only on windows
|
||||
It 'can query a System log' -Skip:(-not $IsWindows) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Add-Content cmdlet tests" -Tags:DRT {
|
||||
Describe "Add-Content cmdlet tests" -Tags "CI" {
|
||||
$file1 = "file1.txt"
|
||||
Setup -File "$file1"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Clear-Content cmdlet tests" -Tags:DRT {
|
||||
Describe "Clear-Content cmdlet tests" -Tags "CI" {
|
||||
$file1 = "file1.txt"
|
||||
Setup -File "$file1"
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ if ($IsWindows -and !$IsCoreCLR) {
|
||||
if ($windowsPrincipal.IsInRole("Administrators") -eq $true) {
|
||||
$NonWinAdmin=$false
|
||||
} else {$NonWinAdmin=$true}
|
||||
Describe "Clear-EventLog cmdlet tests" -Tags:DRT {
|
||||
Describe "Clear-EventLog cmdlet tests" -Tags "CI" {
|
||||
#DRT - CmdLet is NYI - change to -Skip:($NonWinAdmin) when implemented
|
||||
It "should be able to Clear-EventLog" -Pending:($True -Or $NonWinAdmin) {
|
||||
Remove-EventLog -LogName TestLog -ea Ignore
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Get-ChildItem" {
|
||||
Describe "Get-ChildItem" -Tags "CI" {
|
||||
It "Should list the contents of the current folder" {
|
||||
(Get-ChildItem .).Name.Length | Should BeGreaterThan 0
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Get-Content" -Tags:DRT {
|
||||
Describe "Get-Content" -Tags "CI" {
|
||||
$testString = "This is a test content for a file"
|
||||
$nl = [Environment]::NewLine
|
||||
$firstline = "Here's a first line "
|
||||
@@ -131,4 +131,4 @@ Describe "Get-Content" -Tags:DRT {
|
||||
} else {$expected = "Hell","o,ll","ll","Worll","d`nHell","o2,ll","ll","Worll","d2`n"}
|
||||
for ($i = 0; $i -lt $result.Length ; $i++) { $result[$i] | Should BeExactly $expected[$i]}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
if ($windowsPrincipal.IsInRole("Administrators") -eq $true) {
|
||||
$NonWinAdmin=$false
|
||||
} else {exit}
|
||||
Describe "Get-EventLog cmdlet tests" -Tags:DRT {
|
||||
Describe "Get-EventLog cmdlet tests" -Tags "CI" {
|
||||
#CmdLets are not yet implemented, so these cases are -Pending:($True) for now...
|
||||
It "should return an array of eventlogs objects when called with -AsString parameter" -Pending:($True) {
|
||||
{$result=Get-EventLog -AsString -ea stop} | Should Not Throw
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Get-Item" {
|
||||
Describe "Get-Item" -Tags "CI" {
|
||||
It "Should list all the items in the current working directory when asterisk is used" {
|
||||
(Get-Item (Join-Path -Path $PSScriptRoot -ChildPath "*")).GetType().BaseType | Should Be 'array'
|
||||
(Get-Item (Join-Path -Path $PSScriptRoot -ChildPath "*")).GetType().Name | Should Be 'Object[]'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Get-ItemProperty" {
|
||||
Describe "Get-ItemProperty" -Tags "CI" {
|
||||
$currentDirectory = Split-Path $PSScriptRoot -Leaf
|
||||
$parentDirectory = Split-Path (Join-Path -Path $PSScriptRoot -ChildPath "..") -Leaf
|
||||
$tempDirectory = $TestDrive
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Get-Location" {
|
||||
Describe "Get-Location" -Tags "CI" {
|
||||
$currentDirectory=[System.IO.Directory]::GetCurrentDirectory()
|
||||
BeforeEach {
|
||||
pushd $currentDirectory
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Get-PSDrive" {
|
||||
Describe "Get-PSDrive" -Tags "CI" {
|
||||
|
||||
It "Should not throw" {
|
||||
Get-PSDrive | Should Not BeNullOrEmpty
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Get-PSProvider" {
|
||||
Describe "Get-PSProvider" -Tags "CI" {
|
||||
It "Should be able to call with no parameters without error" {
|
||||
{ Get-PSProvider } | Should Not Throw
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Get-Process" {
|
||||
Describe "Get-Process" -Tags "CI" {
|
||||
It "Should support -IncludeUserName" {
|
||||
(Get-Process powershell -IncludeUserName | Select-Object -First 1).UserName | Should Match $env:USERNAME
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Hierarchical paths" {
|
||||
Describe "Hierarchical paths" -Tags "CI" {
|
||||
BeforeAll {
|
||||
$data = "Hello World"
|
||||
Setup -File testFile.txt -Content $data
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Join-Path cmdlet tests" -Tags DRT {
|
||||
Describe "Join-Path cmdlet tests" -Tags "CI" {
|
||||
$SepChar=[io.path]::DirectorySeparatorChar
|
||||
BeforeAll {
|
||||
$StartingLocation = Get-Location
|
||||
@@ -43,4 +43,4 @@ Describe "Join-Path cmdlet tests" -Tags DRT {
|
||||
$result.Count | Should be 1
|
||||
$result | Should BeExactly ("Env:"+$SepChar+"foo")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
if ($windowsPrincipal.IsInRole("Administrators") -eq $true) {
|
||||
$NonWinAdmin=$false
|
||||
} else {$NonWinAdmin=$true}
|
||||
Describe "New-EventLog cmdlet tests" -Tags DRT {
|
||||
Describe "New-EventLog cmdlet tests" -Tags "CI" {
|
||||
BeforeEach {
|
||||
Remove-EventLog -LogName TestLog -ea Ignore
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ function Clean-State
|
||||
}
|
||||
}
|
||||
|
||||
Describe "New-Item" {
|
||||
Describe "New-Item" -Tags "CI" {
|
||||
$tmpDirectory = $TestDrive
|
||||
$testfile = "testfile.txt"
|
||||
$testfolder = "newDirectory"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Pop-Location" {
|
||||
Describe "Pop-Location" -Tags "CI" {
|
||||
$startDirectory = $(Get-Location).Path
|
||||
|
||||
BeforeEach { Set-Location $startDirectory }
|
||||
@@ -25,4 +25,4 @@ Describe "Pop-Location" {
|
||||
}
|
||||
|
||||
Set-Location $startDirectory
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Test-Push-Location" {
|
||||
Describe "Test-Push-Location" -Tags "CI" {
|
||||
New-Variable -Name startDirectory -Value $(Get-Location).Path -Scope Global -Force
|
||||
|
||||
BeforeEach { cd $startDirectory }
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
if ($windowsPrincipal.IsInRole("Administrators") -eq $true) {
|
||||
$NonWinAdmin=$false
|
||||
} else {$NonWinAdmin=$true}
|
||||
Describe "New-EventLog cmdlet tests" -Tags DRT {
|
||||
Describe "New-EventLog cmdlet tests" -Tags "CI" {
|
||||
BeforeEach{
|
||||
Remove-EventLog -LogName TestLog -ea Ignore
|
||||
{New-EventLog -LogName TestLog -Source TestSource -ea Stop} | Should Not Throw
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Remove-Item" {
|
||||
Describe "Remove-Item" -Tags "CI" {
|
||||
$testpath = $TestDrive
|
||||
$testfile = "testfile.txt"
|
||||
$testfilepath = Join-Path -Path $testpath -ChildPath $testfile
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Set-Content cmdlet tests" -Tags:DRT {
|
||||
Describe "Set-Content cmdlet tests" -Tags "CI" {
|
||||
$file1 = "file1.txt"
|
||||
Setup -File "$file1" -Content $file1
|
||||
Context "Set-Content should actually set content" {
|
||||
@@ -48,4 +48,4 @@ Describe "Set-Content cmdlet tests" -Tags:DRT {
|
||||
$result[1] |Should be "world"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Set-Location" {
|
||||
Describe "Set-Location" -Tags "CI" {
|
||||
$startDirectory = Get-Location
|
||||
|
||||
if ($IsWindows)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Split-Path" {
|
||||
Describe "Split-Path" -Tags "CI" {
|
||||
|
||||
It "Should return a string object when invoked" {
|
||||
( Split-Path . ).GetType().Name | Should Be "String"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Start-Process" {
|
||||
Describe "Start-Process" -Tags @("CI","SLOW") {
|
||||
$pingCommand = (Get-Command -CommandType Application ping)[0].Definition
|
||||
$pingDirectory = Split-Path $pingCommand -Parent
|
||||
$tempFile = Join-Path -Path $TestDrive -ChildPath PSTest
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Test-Path" {
|
||||
Describe "Test-Path" -Tags "CI" {
|
||||
BeforeAll {
|
||||
$testdirectory = $TestDrive
|
||||
$testfilename = New-Item -path $testdirectory -Name testfile.txt -ItemType file -Value 1 -force
|
||||
|
||||
@@ -28,7 +28,7 @@ function Assert-ListsSame
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Get-Timezone test case no switches" -tags 'BVT' {
|
||||
Describe "Get-Timezone test case no switches" -Tags "CI" {
|
||||
It "Call without ListAvailable switch returns current TimeZoneInfo" {
|
||||
$observed = (Get-TimeZone).Id
|
||||
$expected = ([System.TimeZoneInfo]::Local).Id
|
||||
@@ -36,7 +36,7 @@ Describe "Get-Timezone test case no switches" -tags 'BVT' {
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Get-Timezone test cases" -tags 'Innerloop','RI' {
|
||||
Describe "Get-Timezone test cases" -Tags "CI" {
|
||||
|
||||
It "Call without ListAvailable switch returns an object of type TimeZoneInfo" {
|
||||
$result = (Get-TimeZone).GetType().Name
|
||||
@@ -118,7 +118,7 @@ Describe "Get-Timezone test cases" -tags 'Innerloop','RI' {
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Set-Timezone test case: call by single Id" -tags 'BVT' {
|
||||
Describe "Set-Timezone test case: call by single Id" -Tags "CI" {
|
||||
$originalTimeZoneId
|
||||
BeforeAll {
|
||||
$originalTimeZoneId = (Get-TimeZone).Id
|
||||
@@ -145,7 +145,7 @@ Describe "Set-Timezone test case: call by single Id" -tags 'BVT' {
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Set-Timezone test cases" -tags 'Innerloop','RI' {
|
||||
Describe "Set-Timezone test cases" -Tags "Feature" {
|
||||
$originalTimeZoneId
|
||||
BeforeAll {
|
||||
$originalTimeZoneId = (Get-TimeZone).Id
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "ExecutionPolicy" {
|
||||
Describe "ExecutionPolicy" -Tags "CI" {
|
||||
|
||||
Context "Check Get-ExecutionPolicy behavior" {
|
||||
It "Should unrestricted when not on Windows" -Skip:$IsWindows {
|
||||
|
||||
@@ -7,7 +7,7 @@ if ($IsWindows) {
|
||||
|
||||
$script:catalogPath = ""
|
||||
|
||||
Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "Innerloop","BVT" {
|
||||
Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" {
|
||||
|
||||
#compare two hashtables
|
||||
function CompareHashTables
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Add-Member DRT Unit Tests" -Tags DRT{
|
||||
Describe "Add-Member DRT Unit Tests" -Tags "CI" {
|
||||
|
||||
It "Mandatory parameters should not be null nor empty" {
|
||||
# when Name is null
|
||||
@@ -278,7 +278,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Add-Member" {
|
||||
Describe "Add-Member" -Tags "CI" {
|
||||
|
||||
It "should be able to see a newly added member of an object" {
|
||||
$o = New-Object psobject
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
$guid = [Guid]::NewGuid().ToString().Replace("-","")
|
||||
|
||||
Describe "Add-Type" {
|
||||
Describe "Add-Type" -Tags "CI" {
|
||||
It "Should not throw given a simple class definition" {
|
||||
{ Add-Type -TypeDefinition "public static class foo { }" } | Should Not Throw
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Clear-Variable DRT Unit Tests" -Tags DRT{
|
||||
Describe "Clear-Variable DRT Unit Tests" -Tags "CI" {
|
||||
It "Clear-Variable normal variable Name should works"{
|
||||
Set-Variable foo bar
|
||||
Clear-Variable -Name foo
|
||||
@@ -97,7 +97,7 @@ Describe "Clear-Variable DRT Unit Tests" -Tags DRT{
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Clear-Variable" {
|
||||
Describe "Clear-Variable" -Tags "CI" {
|
||||
BeforeEach {
|
||||
$var1 = 3
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Compare-Object" {
|
||||
Describe "Compare-Object" -Tags "CI" {
|
||||
BeforeAll {
|
||||
$nl = [Environment]::NewLine
|
||||
|
||||
@@ -120,7 +120,7 @@ Describe "Compare-Object" {
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Compare-Object DRT basic functionality" -Tags DRT{
|
||||
Describe "Compare-Object DRT basic functionality" -Tags "CI" {
|
||||
if(-not ([System.Management.Automation.PSTypeName]'Employee').Type)
|
||||
{
|
||||
Add-Type -TypeDefinition @"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
|
||||
Describe "ConvertFrom-Csv" {
|
||||
Describe "ConvertFrom-Csv" -Tags "CI" {
|
||||
$testObject = "a", "1"
|
||||
$testcsv = Join-Path -Path (Join-Path -Path $here -ChildPath assets) -ChildPath TestCsv2.csv
|
||||
$testName = "Zaphod BeebleBrox"
|
||||
@@ -51,7 +51,7 @@ a,b,c
|
||||
}
|
||||
}
|
||||
|
||||
Describe "ConvertFrom-Csv DRT Unit Tests" -Tags DRT{
|
||||
Describe "ConvertFrom-Csv DRT Unit Tests" -Tags "CI" {
|
||||
It "Test ConvertFrom-Csv with pipelined InputObject and Header" {
|
||||
$inputObject = [pscustomobject]@{ First = 1; Second = 2 }
|
||||
$res = $inputObject | ConvertTo-Csv
|
||||
@@ -62,4 +62,4 @@ Describe "ConvertFrom-Csv DRT Unit Tests" -Tags DRT{
|
||||
$result[1].Header1 | Should Be "1"
|
||||
$result[1].Header2 | Should Be "2"
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
Describe "ConvertFrom-StringData DRT Unit Tests" -Tags DRT {
|
||||
Describe "ConvertFrom-StringData DRT Unit Tests" -Tags "CI" {
|
||||
It "Should able to throw error when convert invalid line" {
|
||||
$str =@"
|
||||
#comments here
|
||||
@@ -18,7 +18,7 @@ def=content of def
|
||||
}
|
||||
}
|
||||
|
||||
Describe "ConvertFrom-StringData" {
|
||||
Describe "ConvertFrom-StringData" -Tags "CI" {
|
||||
$sampleData = @'
|
||||
foo = 0
|
||||
bar = 1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "ConvertTo-Csv DRT Unit Tests" -Tags DRT{
|
||||
Describe "ConvertTo-Csv DRT Unit Tests" -Tags "CI" {
|
||||
$inputObject = [pscustomobject]@{ First = 1; Second = 2 }
|
||||
|
||||
It "Test convertto-csv with psobject pipelined" {
|
||||
@@ -35,7 +35,7 @@ Describe "ConvertTo-Csv DRT Unit Tests" -Tags DRT{
|
||||
}
|
||||
}
|
||||
|
||||
Describe "ConvertTo-Csv" {
|
||||
Describe "ConvertTo-Csv" -Tags "CI" {
|
||||
$Name = "Hello"; $Data = "World";
|
||||
$testObject = New-Object psobject -Property @{ FirstColumn = $Name; SecondColumn = $Data }
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
Describe "ConvertTo-SecureString" {
|
||||
Describe "ConvertTo-SecureString" -Tags "CI" {
|
||||
|
||||
Context "Checking return types of ConvertTo-SecureString" {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "ConvertTo-Xml DRT Unit Tests" -Tags DRT{
|
||||
Describe "ConvertTo-Xml DRT Unit Tests" -Tags "CI" {
|
||||
$customPSObject = [pscustomobject]@{ "prop1" = "val1"; "prop2" = "val2" }
|
||||
$newLine = [System.Environment]::NewLine
|
||||
It "Test convertto-xml with a depth parameter" {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
$removeAliasList = @("ac","compare","cpp","diff","sleep","sort","start","cat","cp","ls","man","mount","mv","ps","rm","rmdir")
|
||||
$keepAliasList = @{cd="Set-Location"},@{dir="Get-ChildItem"},@{echo="Write-output"},@{fc="format-custom"},@{kill="stop-process"},@{clear="clear-host"}
|
||||
Describe "Windows aliases do not conflict with Linux commands" {
|
||||
Describe "Windows aliases do not conflict with Linux commands" -Tags "CI" {
|
||||
foreach ($alias in $removeAliasList) {
|
||||
It "Should not have certain aliases on Linux" -Skip:$IsWindows {
|
||||
Test-Path Alias:$alias | Should Be $false
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
Describe "Environment-Variables" {
|
||||
Describe "Environment-Variables" -Tags "CI" {
|
||||
|
||||
It "Should have environment variables" {
|
||||
Get-Item ENV: | Should Not BeNullOrEmpty
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Export-Alias DRT Unit Tests" -Tags DRT{
|
||||
Describe "Export-Alias DRT Unit Tests" -Tags "CI" {
|
||||
$testAliasDirectory = Join-Path -Path $TestDrive -ChildPath ExportAliasTestDirectory
|
||||
$testAliases = "TestAliases"
|
||||
$fulltestpath = Join-Path -Path $testAliasDirectory -ChildPath $testAliases
|
||||
@@ -124,7 +124,7 @@ Describe "Export-Alias DRT Unit Tests" -Tags DRT{
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Export-Alias" {
|
||||
Describe "Export-Alias" -Tags "CI" {
|
||||
$testAliasDirectory = Join-Path -Path $TestDrive -ChildPath ExportAliasTestDirectory
|
||||
$testAliases = "TestAliases"
|
||||
$fulltestpath = Join-Path -Path $testAliasDirectory -ChildPath $testAliases
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Export-Csv" {
|
||||
Describe "Export-Csv" -Tags "CI" {
|
||||
$testObject = @("test","object","array")
|
||||
$testCsv = "output.csv"
|
||||
|
||||
@@ -65,7 +65,7 @@ Describe "Export-Csv" {
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Export-Csv DRT Unit Tests" -Tags DRT{
|
||||
Describe "Export-Csv DRT Unit Tests" -Tags "CI" {
|
||||
$filePath = Join-Path $TestDrive -ChildPath "test.csv"
|
||||
$newLine = [environment]::NewLine
|
||||
It "Test basic function works well" {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Export-FormatData DRT Unit Tests" -Tags DRT{
|
||||
Describe "Export-FormatData DRT Unit Tests" -Tags "CI" {
|
||||
It "Test basic functionality" {
|
||||
$fd = Get-FormatData
|
||||
$tempFile = Join-Path $TestDrive -ChildPath "exportFormatTest.txt"
|
||||
@@ -14,7 +14,7 @@ Describe "Export-FormatData DRT Unit Tests" -Tags DRT{
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Export-FormatData" {
|
||||
Describe "Export-FormatData" -Tags "CI" {
|
||||
|
||||
Context "Check Export-FormatData can be called validly." {
|
||||
It "Should be able to be called without error" {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Format-Custom" {
|
||||
Describe "Format-Custom" -Tags "CI" {
|
||||
|
||||
Context "Check Format-Custom aliases" {
|
||||
|
||||
@@ -25,7 +25,7 @@ Describe "Format-Custom" {
|
||||
}
|
||||
|
||||
|
||||
Describe "Format-Custom DRT basic functionality" -Tags DRT{
|
||||
Describe "Format-Custom DRT basic functionality" -Tags "CI" {
|
||||
Add-Type -TypeDefinition @"
|
||||
public abstract class NamedItem
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Format-List" {
|
||||
Describe "Format-List" -Tags "CI" {
|
||||
$nl = [Environment]::NewLine
|
||||
BeforeEach {
|
||||
$in = New-Object PSObject
|
||||
@@ -67,7 +67,7 @@ Describe "Format-List" {
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Format-List DRT basic functionality" -Tags DRT{
|
||||
Describe "Format-List DRT basic functionality" -Tags "CI" {
|
||||
It "Format-List with array should work" {
|
||||
$al = (0..255)
|
||||
$info = @{}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Format-Table" {
|
||||
Describe "Format-Table" -Tags "CI" {
|
||||
It "Should call format table on piped input without error" {
|
||||
{ Get-Date | Format-Table } | Should Not Throw
|
||||
|
||||
@@ -28,7 +28,7 @@ Describe "Format-Table" {
|
||||
}
|
||||
|
||||
|
||||
Describe "Format-Table DRT Unit Tests" -Tags DRT{
|
||||
Describe "Format-Table DRT Unit Tests" -Tags "CI" {
|
||||
It "Format-Table with not existing table with force should throw PipelineStoppedException"{
|
||||
$obj = New-Object -typename PSObject
|
||||
try
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Format-Wide" {
|
||||
Describe "Format-Wide" -Tags "CI" {
|
||||
|
||||
It "Should have the same output between the alias and the unaliased function" {
|
||||
$nonaliased = Get-ChildItem | Format-Wide
|
||||
@@ -39,7 +39,7 @@ Describe "Format-Wide" {
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Format-Wide DRT basic functionality" -Tags DRT{
|
||||
Describe "Format-Wide DRT basic functionality" -Tags "CI" {
|
||||
It "Format-Wide with array should work" {
|
||||
$al = (0..255)
|
||||
$info = @{}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
Describe "Get-Alias DRT Unit Tests" -Tags DRT{
|
||||
Describe "Get-Alias DRT Unit Tests" -Tags "CI" {
|
||||
It "Get-Alias Bogus Scope Name should throw PSArgumentException"{
|
||||
try {
|
||||
Get-Alias -Name "ABCD" -Scope "bogus"
|
||||
@@ -173,7 +173,7 @@ Describe "Get-Alias DRT Unit Tests" -Tags DRT{
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Get-Alias" {
|
||||
Describe "Get-Alias" -Tags "CI" {
|
||||
It "Should have a return type of System.Array when gal returns more than one object" {
|
||||
$val1=(Get-Alias a*)
|
||||
$val2=(Get-Alias c*)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Get-Culture DRT Unit Tests" -Tags DRT{
|
||||
Describe "Get-Culture DRT Unit Tests" -Tags "CI" {
|
||||
It "Should works proper with get-culture" {
|
||||
$results = get-Culture
|
||||
$results -is "System.Globalization.CultureInfo" | Should be $true
|
||||
@@ -6,7 +6,7 @@ Describe "Get-Culture DRT Unit Tests" -Tags DRT{
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Get-Culture" {
|
||||
Describe "Get-Culture" -Tags "CI" {
|
||||
|
||||
It "Should return a type of CultureInfo for Get-Culture cmdlet" {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Get-Date DRT Unit Tests" -Tags DRT {
|
||||
Describe "Get-Date DRT Unit Tests" -Tags "CI" {
|
||||
It "Get-Date with all parameters returns proper results" {
|
||||
$date = [datetime]::Now + ([timespan]::new(0,0,30))
|
||||
$result = Get-Date -Date $date -Year 1973 -Month 2 -Day 22 -Hour 15 -Minute 40 -Second 10 -Millisecond 200
|
||||
@@ -80,7 +80,7 @@ Describe "Get-Date DRT Unit Tests" -Tags DRT {
|
||||
}
|
||||
|
||||
|
||||
Describe "Get-Date" {
|
||||
Describe "Get-Date" -Tags "CI" {
|
||||
It "Should return a DateTime object upon being called" {
|
||||
(Get-Date).GetType().Name.Equals('DateTime') | Should Be $true
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Get-Event" {
|
||||
Describe "Get-Event" -Tags "CI" {
|
||||
|
||||
BeforeEach {
|
||||
( New-Event -SourceIdentifier PesterTestEvent -sender Windows.timer -messagedata "PesterTestMessage" )
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Get-EventSubscriber" {
|
||||
Describe "Get-EventSubscriber" -Tags "CI" {
|
||||
|
||||
AfterEach {
|
||||
Unregister-Event -SourceIdentifier PesterTestRegister -ErrorAction SilentlyContinue
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Get-FileHash" {
|
||||
Describe "Get-FileHash" -Tags "CI" {
|
||||
New-Variable testDocument -Value (Join-Path -Path (Join-Path -Path $PSScriptRoot -ChildPath assets) -ChildPath testablescript.ps1) -Scope Global -Force
|
||||
# The MACTripleDES and RIPEMD160 algorithms are unsupported on Linux
|
||||
$algorithms = @{"SHA1" ="01B865D143E07ECC875AB0EFC0A4429387FD0CF7";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Get-FormatData" {
|
||||
Describe "Get-FormatData" -Tags "CI" {
|
||||
|
||||
Context "Check return type of Get-FormatData" {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Get-Host DRT Unit Tests" -Tags DRT{
|
||||
Describe "Get-Host DRT Unit Tests" -Tags "CI" {
|
||||
It "Should works proper with get-host" {
|
||||
$results = Get-Host
|
||||
$results | Should Be $Host
|
||||
@@ -6,7 +6,7 @@ Describe "Get-Host DRT Unit Tests" -Tags DRT{
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Get-Host" {
|
||||
Describe "Get-Host" -Tags "CI" {
|
||||
It "Should return a type of InternalHost for Get-Host cmdlet" {
|
||||
|
||||
(Get-Host).GetType().Name | Should Be InternalHost
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Get-Member" {
|
||||
Describe "Get-Member" -Tags "CI" {
|
||||
It "Should be able to be called on string objects, ints, arrays, etc" {
|
||||
$a = 1 #test numbers
|
||||
$b = 1.3
|
||||
@@ -40,7 +40,7 @@ Describe "Get-Member" {
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Get-Member DRT Unit Tests" -Tags DRT {
|
||||
Describe "Get-Member DRT Unit Tests" -Tags "CI" {
|
||||
Context "Verify Get-Member with Class" {
|
||||
if(-not ([System.Management.Automation.PSTypeName]'Employee').Type)
|
||||
{
|
||||
@@ -291,4 +291,4 @@ Describe "Get-Member DRT Unit Tests" -Tags DRT {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Get-PSBreakpoint" {
|
||||
Describe "Get-PSBreakpoint" -Tags "CI" {
|
||||
|
||||
$scriptName = "Get-PSBreakpoint.Tests.ps1"
|
||||
$fullScriptPath = Join-Path -Path $PSScriptRoot -ChildPath $scriptName
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Get-PSCallStack DRT Unit Tests" -Tags DRT {
|
||||
Describe "Get-PSCallStack DRT Unit Tests" -Tags "CI" {
|
||||
BeforeAll {
|
||||
$scriptFileName = "GetTryCatchCallStack.ps1"
|
||||
$scriptFilePath = Join-Path $TestDrive -ChildPath $scriptFileName
|
||||
@@ -84,4 +84,4 @@
|
||||
$results[1].ScriptLineNumber | Should be 7
|
||||
$results[1].InvocationInfo.ScriptLineNumber | Should be 75
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Get-Random DRT Unit Tests" -Tags DRT{
|
||||
Describe "Get-Random DRT Unit Tests" -Tags "CI" {
|
||||
$testData = @(
|
||||
@{ Name = 'no params'; Maximum = $null; Minimum = $null; GreaterThan = -1; LessThan = ([int32]::MaxValue); Type = 'System.Int32' }
|
||||
@{ Name = 'only positive maximum number'; Maximum = 100; Minimum = $null; GreaterThan = -1; LessThan = 100; Type = 'System.Int32' }
|
||||
@@ -89,7 +89,7 @@ Describe "Get-Random DRT Unit Tests" -Tags DRT{
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Get-Random" {
|
||||
Describe "Get-Random" -Tags "CI" {
|
||||
It "Should return a random number greater than -1 " {
|
||||
Get-Random | Should BeGreaterThan -1
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Get-RunspaceDebug" {
|
||||
Describe "Get-RunspaceDebug" -Tags "CI" {
|
||||
|
||||
Context "Check return types of RunspaceDebug" {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Get-TraceSource" -tags "P1" {
|
||||
Describe "Get-TraceSource" -Tags "Feature" {
|
||||
It "Should output data sorted by name" {
|
||||
$expected = (Get-TraceSource | Sort-Object Name)
|
||||
Get-TraceSource | Should be $expected
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Get-UICulture" {
|
||||
Describe "Get-UICulture" -Tags "CI" {
|
||||
It "Should return a type of CultureInfo as the name of the type" {
|
||||
(Get-UICulture).GetType().Name | Should Match CultureInfo
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Get-Unique DRT Unit Tests" -Tags DRT{
|
||||
Describe "Get-Unique DRT Unit Tests" -Tags "CI" {
|
||||
It "Command get-unique works with AsString switch" {
|
||||
$inputArray = "aa","aa","Aa","ba","BA","BA"
|
||||
$results = $inputArray | Get-Unique -AsString
|
||||
@@ -17,7 +17,7 @@ Describe "Get-Unique DRT Unit Tests" -Tags DRT{
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Get-Unique" {
|
||||
Describe "Get-Unique" -Tags "CI" {
|
||||
$sortedList1 = 1,2,2,3,3,4,5
|
||||
It "Should be able to use the Get-Unique cmdlet without error with inputObject switch" {
|
||||
{ Get-Unique -InputObject $sortedList1 } | Should Not Throw
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
Describe "Get-Variable DRT Unit Tests" -Tags DRT{
|
||||
Describe "Get-Variable DRT Unit Tests" -Tags "CI" {
|
||||
It "Get-Variable of not existing variable Name should throw ItemNotFoundException"{
|
||||
try {
|
||||
Get-Variable -EA Stop -Name nonexistingVariableName
|
||||
@@ -52,7 +52,7 @@ Describe "Get-Variable DRT Unit Tests" -Tags DRT{
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Get-Variable" {
|
||||
Describe "Get-Variable" -Tags "CI" {
|
||||
It "Should be able to call with no parameters without error" {
|
||||
{ Get-Variable } | Should Not Throw
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Group-Object DRT Unit Tests" -Tags DRT{
|
||||
Describe "Group-Object DRT Unit Tests" -Tags "CI" {
|
||||
It "Test for CaseSensitive switch" {
|
||||
$testObject = 'aA', 'aA', 'AA', 'AA'
|
||||
$results = $testObject | Group-Object -CaseSensitive
|
||||
@@ -11,7 +11,7 @@ Describe "Group-Object DRT Unit Tests" -Tags DRT{
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Group-Object" {
|
||||
Describe "Group-Object" -Tags "CI" {
|
||||
$testObject = Get-ChildItem
|
||||
|
||||
It "Should be called using an object as piped without error with no switches" {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Import-Alias DRT Unit Tests" -Tags DRT{
|
||||
Describe "Import-Alias DRT Unit Tests" -Tags "CI" {
|
||||
$testAliasDirectory = Join-Path -Path $TestDrive -ChildPath ImportAliasTestDirectory
|
||||
$testAliases = "TestAliases"
|
||||
$fulltestpath = Join-Path -Path $testAliasDirectory -ChildPath $testAliases
|
||||
@@ -61,7 +61,7 @@ Describe "Import-Alias DRT Unit Tests" -Tags DRT{
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Import-Alias" {
|
||||
Describe "Import-Alias" -Tags "CI" {
|
||||
$newLine=[Environment]::NewLine
|
||||
$testAliasDirectory = Join-Path -Path $TestDrive -ChildPath ImportAliasTestDirectory
|
||||
$testAliases = "pesteralias.txt"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Import-Csv" {
|
||||
Describe "Import-Csv" -Tags "CI" {
|
||||
$testCsv = Join-Path -Path (Join-Path $PSScriptRoot -ChildPath assets) -ChildPath TestCsv.csv
|
||||
|
||||
It "Should be able to call without error" {
|
||||
@@ -50,7 +50,7 @@ Describe "Import-Csv" {
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Import-Csv DRT Unit Tests" -Tags DRT {
|
||||
Describe "Import-Csv DRT Unit Tests" -Tags "CI" {
|
||||
BeforeAll {
|
||||
$fileToGenerate = Join-Path $TestDrive -ChildPath "importCSVTest.csv"
|
||||
$psObject = [pscustomobject]@{ "First" = "1"; "Second" = "2" }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
$assetsDir = Join-Path -Path $PSScriptRoot -ChildPath assets
|
||||
|
||||
Describe "Import-LocalizedData" {
|
||||
Describe "Import-LocalizedData" -Tags "CI" {
|
||||
|
||||
BeforeAll {
|
||||
$script = "localized.ps1"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Invoke-Expression" {
|
||||
Describe "Invoke-Expression" -Tags "CI" {
|
||||
|
||||
Context "Should execute the invoked command validly" {
|
||||
|
||||
@@ -27,9 +27,9 @@ Describe "Invoke-Expression" {
|
||||
}
|
||||
}
|
||||
}
|
||||
Describe "Invoke-Expression DRT Unit Tests" -Tags DRT{
|
||||
Describe "Invoke-Expression DRT Unit Tests" -Tags "CI" {
|
||||
It "Invoke-Expression should work"{
|
||||
$result=invoke-expression -Command 2+2
|
||||
$result|Should Be 4
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using namespace System.Diagnostics
|
||||
|
||||
Describe "Invoke-Item" {
|
||||
Describe "Invoke-Item" -Tags "CI" {
|
||||
|
||||
function NewProcessStartInfo([string]$CommandLine, [switch]$RedirectStdIn)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Measure-Command" {
|
||||
Describe "Measure-Command" -Tags "CI" {
|
||||
|
||||
Context "Validate return types for Measure-Command" {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Measure-Object" {
|
||||
Describe "Measure-Object" -Tags "CI" {
|
||||
$testObject = 1,3,4
|
||||
|
||||
It "Should be able to be called without error" {
|
||||
@@ -158,7 +158,7 @@ Describe "Measure-Object" {
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Measure-Object DRT basic functionality" -Tags DRT{
|
||||
Describe "Measure-Object DRT basic functionality" -Tags "CI" {
|
||||
|
||||
BeforeAll {
|
||||
if(-not ([System.Management.Automation.PSTypeName]'TestMeasureGeneric').Type)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "New-Alias DRT Unit Tests" -Tags DRT{
|
||||
Describe "New-Alias DRT Unit Tests" -Tags "CI" {
|
||||
It "New-Alias Constant should throw SessionStateUnauthorizedAccessException"{
|
||||
try {
|
||||
New-Alias -Name "ABCD" -Value "foo" -Option "Constant" -Force:$true
|
||||
@@ -39,7 +39,7 @@ Describe "New-Alias DRT Unit Tests" -Tags DRT{
|
||||
}
|
||||
}
|
||||
|
||||
Describe "New-Alias" {
|
||||
Describe "New-Alias" -Tags "CI" {
|
||||
It "Should be able to be called using the name and value parameters without error" {
|
||||
{ New-Alias -Name testAlias -Value 100 } | Should Not Throw
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "New-Event" {
|
||||
Describe "New-Event" -Tags "CI" {
|
||||
|
||||
Context "Check return type of New-Event" {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "New-Object" {
|
||||
Describe "New-Object" -Tags "CI" {
|
||||
It "should create an object with 4 fields" {
|
||||
$o = New-Object psobject
|
||||
$val = $o.GetType()
|
||||
@@ -33,7 +33,7 @@ Describe "New-Object" {
|
||||
}
|
||||
}
|
||||
|
||||
Describe "New-Object DRT basic functionality" -Tags DRT{
|
||||
Describe "New-Object DRT basic functionality" -Tags "CI" {
|
||||
It "New-Object with int array should work"{
|
||||
$result = New-Object -TypeName int[] -Arg 10
|
||||
$result.Count | Should Be 10
|
||||
@@ -164,4 +164,4 @@ Describe "New-Object DRT basic functionality" -Tags DRT{
|
||||
$result = New-Object -TypeName PSObject -property @{foo=123}
|
||||
$result.foo | Should Be 123
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "New-TimeSpan DRT Unit Tests" -Tags DRT{
|
||||
Describe "New-TimeSpan DRT Unit Tests" -Tags "CI" {
|
||||
It "Should works proper with new-timespan"{
|
||||
$results = New-TimeSpan -Days 10 -Hours 10 -Minutes 10 -Seconds 10
|
||||
$results.GetType() | Should Be timespan
|
||||
@@ -9,7 +9,7 @@ Describe "New-TimeSpan DRT Unit Tests" -Tags DRT{
|
||||
}
|
||||
}
|
||||
|
||||
Describe "New-TimeSpan" {
|
||||
Describe "New-TimeSpan" -Tags "CI" {
|
||||
It "Should be able to create a new timespan object" {
|
||||
New-Variable -Name testObject -Value $(New-TimeSpan)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
Describe "New-Variable DRT Unit Tests" -Tags DRT{
|
||||
Describe "New-Variable DRT Unit Tests" -Tags "CI" {
|
||||
It "New-Variable variable with description should works"{
|
||||
New-Variable foo bar -description "my description"
|
||||
$var1=Get-Variable -Name foo
|
||||
@@ -57,7 +57,7 @@ Describe "New-Variable DRT Unit Tests" -Tags DRT{
|
||||
}
|
||||
}
|
||||
|
||||
Describe "New-Variable" {
|
||||
Describe "New-Variable" -Tags "CI" {
|
||||
It "Should create a new variable with no parameters" {
|
||||
{ New-Variable var1 } | Should Not Throw
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Out-File DRT Unit Tests" -Tags DRT{
|
||||
Describe "Out-File DRT Unit Tests" -Tags "CI" {
|
||||
It "Should be able to write the contens into a file with -pspath" {
|
||||
$tempFile = "ExposeBug928965"
|
||||
{ 1 | Out-File -PSPath $tempFile } | Should Not Throw
|
||||
@@ -17,7 +17,7 @@ Describe "Out-File DRT Unit Tests" -Tags DRT{
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Out-File" {
|
||||
Describe "Out-File" -Tags "CI" {
|
||||
$expectedContent = "some test text"
|
||||
$inObject = New-Object psobject -Property @{text=$expectedContent}
|
||||
$testfile = Join-Path -Path $TestDrive -ChildPath outfileTest.txt
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Out-String DRT Unit Tests" -Tags DRT{
|
||||
Describe "Out-String DRT Unit Tests" -Tags "CI" {
|
||||
|
||||
It "check display of properties with names containing wildcard characters" {
|
||||
$results = new-object psobject | add-member -passthru noteproperty 'name with square brackets: [0]' 'myvalue' | out-string
|
||||
@@ -10,7 +10,7 @@ Describe "Out-String DRT Unit Tests" -Tags DRT{
|
||||
|
||||
}
|
||||
|
||||
Describe "Out-String" {
|
||||
Describe "Out-String" -Tags "CI" {
|
||||
$nl = [Environment]::NewLine
|
||||
|
||||
It "Should accumulate the strings and returns them as a single string" {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Register-EngineEvent" {
|
||||
Describe "Register-EngineEvent" -Tags "CI" {
|
||||
|
||||
Context "Check return type of Register-ObjectEvent" {
|
||||
It "Should return System.Management.Automation.PSEventJob as return type of Register-EngineEvent" {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Register-ObjectEvent" {
|
||||
Describe "Register-ObjectEvent" -Tags "CI" {
|
||||
|
||||
BeforeEach {
|
||||
$pesterobject = (New-Object System.Collections.ObjectModel.ObservableCollection[object])
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Remove-Event" {
|
||||
Describe "Remove-Event" -Tags "CI" {
|
||||
|
||||
BeforeEach {
|
||||
New-Event -sourceidentifier PesterTimer -sender Windows.timer -messagedata "PesterTestMessage"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Remove-PSBreakpoint" {
|
||||
Describe "Remove-PSBreakpoint" -Tags "CI" {
|
||||
# Set up test script
|
||||
$testScript = Join-Path -Path (Join-Path -Path $PSScriptRoot -ChildPath assets) -ChildPath psbreakpointtestscript.ps1
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Remove-TypeData DRT Unit Tests" -Tags DRT {
|
||||
Describe "Remove-TypeData DRT Unit Tests" -Tags "CI" {
|
||||
BeforeAll {
|
||||
$XMLFile1 = Join-Path $TestDrive -ChildPath "testFile1.ps1xml"
|
||||
$XMLFile2 = Join-Path $TestDrive -ChildPath "testFile2.ps1xml"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# ensure the machine is in a clean state from the outset.
|
||||
Remove-Variable -Name var1 -ErrorAction SilentlyContinue -Force
|
||||
|
||||
Describe "Remove-Variable" {
|
||||
Describe "Remove-Variable" -Tags "CI" {
|
||||
It "Should throw an error when a dollar sign is used in the variable name place" {
|
||||
New-Variable -Name var1 -Value 4
|
||||
|
||||
@@ -193,7 +193,7 @@ Describe "Remove-Variable" {
|
||||
}
|
||||
|
||||
|
||||
Describe "Remove-Variable basic functionality" -Tags DRT{
|
||||
Describe "Remove-Variable basic functionality" -Tags "CI" {
|
||||
It "Remove-Variable variable should works"{
|
||||
New-Variable foo bar
|
||||
Remove-Variable foo
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
. (Join-Path -Path $PSScriptRoot -ChildPath Test-Mocks.ps1)
|
||||
|
||||
Describe "Select-Object" {
|
||||
Describe "Select-Object" -Tags "CI" {
|
||||
BeforeEach {
|
||||
$dirObject = GetFileMock
|
||||
$TestLength = 3
|
||||
@@ -113,7 +113,7 @@ Describe "Select-Object" {
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Select-Object DRT basic functionality" -Tags DRT{
|
||||
Describe "Select-Object DRT basic functionality" -Tags "CI" {
|
||||
BeforeAll {
|
||||
$employees = [pscustomobject]@{"FirstName"="joseph"; "LastName"="smith"; "YearsInMS"=15},
|
||||
[pscustomobject]@{"FirstName"="paul"; "LastName"="smith"; "YearsInMS"=15},
|
||||
@@ -247,4 +247,4 @@ Describe "Select-Object DRT basic functionality" -Tags DRT{
|
||||
$results.Count | Should Be 1
|
||||
$results[0] | Should Be "3"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Select-String" {
|
||||
Describe "Select-String" -Tags "CI" {
|
||||
$nl = [Environment]::NewLine
|
||||
$currentDirectory = $pwd.Path
|
||||
Context "String actions" {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
Describe "Select-XML DRT Unit Tests" -Tags DRT{
|
||||
Describe "Select-XML DRT Unit Tests" -Tags "CI" {
|
||||
|
||||
BeforeAll {
|
||||
$testfile = Join-Path -Path $TestDrive -ChildPath "testfile.xml"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
Describe "Set-Alias DRT Unit Tests" -Tags DRT{
|
||||
Describe "Set-Alias DRT Unit Tests" -Tags "CI" {
|
||||
It "Set-Alias Invalid Scope Name should throw PSArgumentException"{
|
||||
try {
|
||||
Set-Alias -Name "ABCD" -Value "foo" -Scope "bogus"
|
||||
@@ -83,7 +83,7 @@ Describe "Set-Alias DRT Unit Tests" -Tags DRT{
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Set-Alias" {
|
||||
Describe "Set-Alias" -Tags "CI" {
|
||||
Mock Get-Date { return "Friday, October 30, 2015 3:38:08 PM" }
|
||||
It "Should be able to set alias without error" {
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
$ps = Join-Path -Path $PsHome -ChildPath "powershell"
|
||||
|
||||
Describe "Set-PSBreakpoint DRT Unit Tests" -Tags DRT {
|
||||
Describe "Set-PSBreakpoint DRT Unit Tests" -Tags "CI" {
|
||||
#Set up
|
||||
$scriptFileName = Join-Path $TestDrive -ChildPath breakpointTestScript.ps1
|
||||
$scriptFileNameBug = Join-Path -Path $TestDrive -ChildPath SetPSBreakpointTests.ExposeBug154112.ps1
|
||||
@@ -189,7 +189,7 @@ set-psbreakpoint -command foo
|
||||
Remove-Item -Path $scriptFileNameBug -Force
|
||||
}
|
||||
|
||||
Describe "Set-PSBreakpoint" {
|
||||
Describe "Set-PSBreakpoint" -Tags "CI" {
|
||||
# Set up test script
|
||||
$testScript = Join-Path -Path $PSScriptRoot -ChildPath psbreakpointtestscript.ps1
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
Describe "Set-Variable DRT Unit Tests" -Tags DRT{
|
||||
Describe "Set-Variable DRT Unit Tests" -Tags "CI" {
|
||||
It "Set-Variable normal variable Name should works"{
|
||||
Set-Variable foo bar
|
||||
$var1=Get-Variable -Name foo
|
||||
@@ -161,7 +161,7 @@ Describe "Set-Variable DRT Unit Tests" -Tags DRT{
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Set-Variable" {
|
||||
Describe "Set-Variable" -Tags "CI" {
|
||||
It "Should create a new variable with no parameters" {
|
||||
{ Set-Variable testVar } | Should Not Throw
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Sort-Object" {
|
||||
Describe "Sort-Object" -Tags "CI" {
|
||||
|
||||
It "should be able to sort object in ascending with using Property switch" {
|
||||
{ Get-ChildItem -Path $PSScriptRoot -Include *.ps1 -Recurse | Sort-Object -Property Length } | Should Not Throw
|
||||
@@ -20,7 +20,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Sort-Object DRT Unit Tests" -Tags DRT{
|
||||
Describe "Sort-Object DRT Unit Tests" -Tags "CI" {
|
||||
It "Sort-Object with object array should work"{
|
||||
$employee1 = [pscustomobject]@{"FirstName"="Eight"; "LastName"="Eight"; "YearsInMS"=8}
|
||||
$employee2 = [pscustomobject]@{"FirstName"="Eight"; "YearsInMS"=$null}
|
||||
@@ -221,4 +221,4 @@ Describe "Sort-Object DRT Unit Tests" -Tags DRT{
|
||||
$results[1] | Should Be 2
|
||||
$results[2] | Should Be 1
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Start-Sleep DRT Unit Tests" -Tags DRT{
|
||||
Describe "Start-Sleep DRT Unit Tests" -Tags "CI" {
|
||||
It "Should be works properly when sleeping with Second" {
|
||||
$dtStart = [DateTime]::Now
|
||||
Start-Sleep -Seconds 1
|
||||
@@ -17,7 +17,7 @@ Describe "Start-Sleep DRT Unit Tests" -Tags DRT{
|
||||
|
||||
}
|
||||
|
||||
Describe "Start-Sleep" {
|
||||
Describe "Start-Sleep" -Tags "CI" {
|
||||
|
||||
Context "Validate Start-Sleep works properly" {
|
||||
It "Should only sleep for at least 1 second" {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Tee-Object" {
|
||||
Describe "Tee-Object" -Tags "CI" {
|
||||
|
||||
Context "Validate Tee-Object is correctly forking output" {
|
||||
|
||||
@@ -20,7 +20,7 @@ Describe "Tee-Object" {
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Tee-Object DRT Unit Tests" -Tags DRT {
|
||||
Describe "Tee-Object DRT Unit Tests" -Tags "CI" {
|
||||
BeforeAll {
|
||||
$tempFile = Join-Path $TestDrive -ChildPath "TeeObjectTestsTempFile"
|
||||
}
|
||||
@@ -45,4 +45,4 @@ Describe "Tee-Object DRT Unit Tests" -Tags DRT {
|
||||
$results | Should Be $expected
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
# This came from monad/tests/ci/PowerShell/tests/Commands/Cmdlets/pester.utility.command.tests.ps1
|
||||
Describe "Trace-Command" -tags "P1", "RI" {
|
||||
Describe "Trace-Command" -tags "Feature" {
|
||||
|
||||
Context "Listner options" {
|
||||
BeforeAll {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Describe "Update-FormatData" {
|
||||
Describe "Update-FormatData" -Tags "CI" {
|
||||
|
||||
BeforeAll {
|
||||
$path = Join-Path -Path $TestDrive -ChildPath "outputfile.ps1xml"
|
||||
@@ -27,7 +27,7 @@ Describe "Update-FormatData" {
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Update-FormatData basic functionality" -Tags DRT{
|
||||
Describe "Update-FormatData basic functionality" -Tags "CI" {
|
||||
BeforeAll {
|
||||
$testfilename = "testfile.ps1xml"
|
||||
$testfile = Join-Path -Path $TestDrive -ChildPath $testfilename
|
||||
|
||||
Loaded 100 of 145 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user