-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add: Multilenguaje compatible (spanish , english).
Add: function from filter from state Add:PowerScheduledTasks.tests.ps1 . (Test file with Psate) Update:README Tested in windows 2003 and windows 8
- Loading branch information
robertolabarca
authored and
robertolabarca
committed
Mar 21, 2013
1 parent
41c0255
commit 0013b17
Showing
5 changed files
with
131 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
TestScope "PowerScheduledTasks.psm1" { | ||
|
||
# import the script | ||
Import-Module ".\PowerScheduledTasks.psm1" | ||
Enable-Mock | iex | ||
Describing "PowerScheduledTasks" { | ||
|
||
Given "PowerScheduledTasks" { | ||
TestSetup { | ||
Mock Get-ScheduledTask { | ||
$objScheduledTaskName = New-Object System.Object | ||
$objScheduledTaskName | Add-Member -MemberType NoteProperty -Name TaskName -Value "Prueba" | ||
$objScheduledTaskName | Add-Member -MemberType NoteProperty -Name TaskStatus -Value "Listo" | ||
$objScheduledTaskName | Where-Object { $_.TaskName -match $TaskName } | ||
} -When {$TaskStatus -eq "Listo"} | ||
|
||
Mock Get-ScheduledTask { | ||
$objScheduledTaskName = New-Object System.Object | ||
$objScheduledTaskName | Add-Member -MemberType NoteProperty -Name TaskName -Value "PruebaDes" | ||
$objScheduledTaskName | Add-Member -MemberType NoteProperty -Name TaskStatus -Value "Deshabilitado" | ||
|
||
$objScheduledTaskName | Where-Object { $_.TaskName -match $TaskName } | ||
|
||
} -When {$TaskStatus -eq "Deshabilitado"} | ||
|
||
Mock Get-ScheduledTask{ | ||
$obj=new-object System.Collections.ArrayList | ||
$objScheduledTaskName = New-Object System.Object | ||
$objScheduledTaskName | Add-Member -MemberType NoteProperty -Name TaskName -Value "Tarea1" | ||
$objScheduledTaskName | Add-Member -MemberType NoteProperty -Name TaskStatus -Value "Deshabilitado" | ||
$obj.Add($objScheduledTaskName) | ||
$objScheduledTaskName = New-Object System.Object | ||
$objScheduledTaskName | Add-Member -MemberType NoteProperty -Name TaskName -Value "Tarea2" | ||
$objScheduledTaskName | Add-Member -MemberType NoteProperty -Name TaskStatus -Value "Deshabilitado" | ||
$obj.Add($objScheduledTaskName) | ||
$objScheduledTaskName = New-Object System.Object | ||
$objScheduledTaskName | Add-Member -MemberType NoteProperty -Name TaskName -Value "Tarea3" | ||
$objScheduledTaskName | Add-Member -MemberType NoteProperty -Name TaskStatus -Value "Listo" | ||
$obj.Add($objScheduledTaskName) | ||
$objScheduledTaskName = New-Object System.Object | ||
$objScheduledTaskName | Add-Member -MemberType NoteProperty -Name TaskName -Value "Tarea4" | ||
$objScheduledTaskName | Add-Member -MemberType NoteProperty -Name TaskStatus -Value "Ejecut ndose" | ||
$obj.Add($objScheduledTaskName) | ||
$objScheduledTaskName = New-Object System.Object | ||
$objScheduledTaskName | Add-Member -MemberType NoteProperty -Name TaskName -Value "Tarea5" | ||
$objScheduledTaskName | Add-Member -MemberType NoteProperty -Name TaskStatus -Value "Listo" | ||
$obj.Add($objScheduledTaskName) | ||
$objScheduledTaskName = New-Object System.Object | ||
$objScheduledTaskName | Add-Member -MemberType NoteProperty -Name TaskName -Value "Tarea6" | ||
$objScheduledTaskName | Add-Member -MemberType NoteProperty -Name TaskStatus -Value "Ejecut ndose" | ||
$obj.Add($objScheduledTaskName) | ||
$obj | ||
|
||
} | ||
|
||
} | ||
|
||
|
||
It "Get-ScheduledTaskFilterby" { | ||
$TaskStatus="Listo" | ||
$resu= Get-ScheduledTaskFilterby -TaskStatus "Listo" | ||
$resu.TaskName | should be "Prueba" | ||
} | ||
|
||
It "Get-ScheduledTaskFilterby" { | ||
$TaskStatus="Deshabilitado" | ||
$resu= Get-ScheduledTaskFilterby -TaskStatus "Deshabilitado" | ||
$resu.TaskName | should be "PruebaDes" | ||
} | ||
|
||
It "Get-ScheduledTaskFilterby" { | ||
$TaskStatus="Deshabilitado" | ||
$resu= Get-ScheduledTaskFilterby -TaskStatus "Ejecut ndose" | ||
$resu.count | should be 2 | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ConvertFrom-StringData @' | ||
statusdisa = Disabled | ||
statusrun = Running | ||
statusnotrun = Not Running | ||
'@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ConvertFrom-StringData @' | ||
statusdisa = Deshabilitado | ||
statusrun = Ejecut ndose | ||
statusnotrun = Listo | ||
'@ |