Removed spurious tests

This commit is contained in:
Zachary Folwick 2015-12-28 11:12:46 -08:00
parent de2af02ff7
commit 9813d3d4b3
5 changed files with 0 additions and 125 deletions

View File

@ -1,14 +0,0 @@
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
Describe "Set-PSBreakpoint" {
New-Variable -Name script -Value $here/assets/testablescript.ps1 -Scope Global -Force
It "Should be able to called with script and line parameters without error " {
{ Set-PSBreakpoint -Script $script -Line 1 } | Should Not Throw
}
It "Should be able to be called using the command switch" {
# Note- we don't actually require the command to exist in the script- it will simply not get a breakpoint
{ Set-PSBreakpoint -Script $script -Command aoeuaoeu } | Should Not Throw
}
}

View File

@ -1,14 +0,0 @@
Describe "Wait-Event" {
Context "Validate Wait-Event is waiting for events" {
It "Should time out when it does not receive a FakeEvent" {
# Don't depend on Measure-Command
$stopwatch = [System.Diagnostics.Stopwatch]::startNew()
# Testing the the timeout, so wait for an event that will never be
# raised because it is fake
Wait-Event -Timeout 1 -SourceIdentifier "FakeEvent"
$stopwatch.Stop()
$stopwatch.ElapsedMilliseconds | Should BeGreaterThan 1000
}
}
}

View File

@ -1,46 +0,0 @@
Describe "Test-ConvertTo-Xml" {
$testObject = Get-ChildItem
$slash = [System.IO.Path]::DirectorySeparatorChar
$testDirectory = $Env:TEMP + $slash + "testDirectory"
$testfile = $testDirectory + $slash + "testfile.xml"
$nl = [Environment]::NewLine
New-Item $testDirectory -ItemType Directory -Force
It "Should create an xml Document" {
$($testObject | ConvertTo-Xml).GetType().Name | Should Be XmlDocument
}
It "Should be able to save an object after being converted to an xml object" {
{ $xml = $testObject | ConvertTo-Xml
$xml.Save($testfile) } | Should Not Throw
Test-Path $testfile | Should Be $true
}
It "Should have a data type of XmlDocument and a BaseType of System.Xml.XmlNode" {
$actual = $testObject | ConvertTo-Xml
}
It "Should be able to use the As switch without error" {
{ ConvertTo-Xml -InputObject $testObject -As String } | Should Not Throw
{ ConvertTo-Xml -InputObject $testObject -As Document } | Should Not Throw
{ ConvertTo-Xml -InputObject $testObject -As Stream } | Should Not Throw
}
It "Should be the same output between the As switch and just saving the file as an xml document" {
# Create the test object, and do some formatting to get it in a testable format
$asSwitch = ($testObject | ConvertTo-Xml -As String).Split([Environment]::NewLine,[System.StringSplitOptions]::RemoveEmptyEntries)
($testObject | ConvertTo-Xml).Save($testfile)
# iterate through each line and compare the saved variable and the file contents
for($line=0; $line -le $testfile.Length; $line++)
{
$currentLine = (Get-Content $testfile)[$line]
$currentLine | Should Be $asSwitch[$line]
}
}
}

View File

@ -1,51 +0,0 @@
<<<<<<< HEAD
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
Describe "Set-PSBreakpoint" {
New-Variable -Name script -Value $here/assets/testablescript.ps1 -Scope Global -Force
It "Should be able to called with script and line parameters without error " {
{ Set-PSBreakpoint -Script $script -Line 1 } | Should Not Throw
}
It "Should be able to be called using the command switch" {
# Note- we don't actually require the command to exist in the script- it will simply not get a breakpoint
{ Set-PSBreakpoint -Script $script -Command aoeuaoeu } | Should Not Throw
}
}
=======
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
Describe "Set-PSBreakpoint" {
# Set up test script
$testScript = "$here/psbreakpointtestscript.ps1"
"`$var = 1 " > $testScript
It "Should be able to set a psbreakpoint on a line" {
$lineNumber = 1
$(Set-PSBreakpoint -Line $lineNumber -Script $testScript).Line | Should Be $lineNumber
}
It "Should throw when a string is entered for a line number" {
{
$lineNumber = "one"
$(Set-PSBreakpoint -Line $lineNumber -Script $testScript).Line
} | Should Throw
}
It "Should be able to set a psbreakpoint on a Command" {
$command = "theCommand"
$(Set-PSBreakpoint -Command $command -Script $testScript).Command | Should Be $command
}
It "Should be able to set a psbreakpoint on a variable" {
$var = "theVariable"
$(Set-PSBreakpoint -Command $var -Script $testScript).Command | Should Be $var
}
# clean up after ourselves
Remove-Item -Path $testScript
}
>>>>>>> master

Binary file not shown.