Skip to content

Commit

Permalink
Update New-PSFRunspaceDispatcher.Tests.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
FriedrichWeinmann committed Nov 5, 2023
1 parent 690c2d5 commit 5e64809
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@
& (Get-Module PSFramework) { $script:runspaceWorkflows = @{ } }
}

It "Should create a new Runspace Dispatcher without error" {
It "Should create a new Runspace Workflow without error" {
{ New-PSFRunspaceWorkflow -Name "Test" } | Should -Not -Throw
}
It "Should return a dispatcher object with the correct name and no workers" {
It "Should return a workflow object with the correct name and no workers" {
$workflow = New-PSFRunspaceWorkflow -Name "Test"
$workflow | Should -Not -BeNullOrEmpty
$workflow.Name | Should -Be 'Test'
$workflow.Workers.Count | Should -Be 0
}
It "Should refuse creating a dispatcher that already exists" {
It "Should refuse creating a workflow that already exists" {
$null = New-PSFRunspaceWorkflow -Name "Test"
{ New-PSFRunspaceWorkflow -Name "Test" } | Should -Throw
}
It "Should overwrite a dispatcher that already exists when using Force" {
It "Should overwrite a workflow that already exists when using Force" {
$workflow = New-PSFRunspaceWorkflow -Name "Test"
$workflow.Queues.Test.Enqueue(42)
{ New-PSFRunspaceWorkflow -Name "Test" -Force } | Should -Not -Throw
$newDispatcher = Get-PSFRunspaceWorkflow -Name Test
$newDispatcher.Queues.Test.Count | Should -Be 0
$newWorkflow = Get-PSFRunspaceWorkflow -Name Test
$newWorkflow.Queues.Test.Count | Should -Be 0
}
}

0 comments on commit 5e64809

Please sign in to comment.