Skip to content

Commit

Permalink
another kind of setup (do Find-DbaAgent)
Browse files Browse the repository at this point in the history
  • Loading branch information
niphlod committed Jul 30, 2024
1 parent 82c6434 commit 893d92a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/Find-DbaAgentJob.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' {
}

Describe "$CommandName Integration Tests" -Tags "IntegrationTests" {
Context "Make sure Agent is running" {
$results = Get-Service | Where-Object Name -like '*SqlAgent*'
foreach($ag in $results) {
It "$($ag.Name) status should be started" {
$ag.Status | Should -Be "Running"
}
}
}
#Context "Make sure Agent is running" {
# $results = Get-Service | Where-Object Name -like '*SqlAgent*'
# foreach($ag in $results) {
# It "$($ag.Name) status should be started" {
# $ag.Status | Should -Be "Running"
# }
# }
#}
Context "Command finds jobs using all parameters" {
BeforeAll {
$null = New-DbaAgentJob -SqlInstance $script:instance2 -Job 'dbatoolsci_testjob' -OwnerLogin 'sa'
Expand Down Expand Up @@ -64,9 +64,9 @@ Describe "$CommandName Integration Tests" -Tags "IntegrationTests" {
It "Should find jobs that have not been scheduled" {
$results | Should not be null
}
$results = Find-DbaAgentJob -SqlInstance $script:instance2 -IsNotScheduled
It "Should find 11 jobs that have no schedule" {
$results.count | Should be 13
$results = Find-DbaAgentJob -SqlInstance $script:instance2 -IsNotScheduled -Job *dbatoolsci*
It "Should find 2 jobs that have no schedule" {
$results.count | Should be 2
}
$results = Find-DbaAgentJob -SqlInstance $script:instance2 -IsNoEmailNotification
It "Should find jobs that have no email notification" {
Expand Down

0 comments on commit 893d92a

Please sign in to comment.