Update higher.Tests.ps1

pester tests pass for all kinds
- increased sleeps after restarts to 2s
- added tags to test types
This commit is contained in:
pblivingston 2025-11-28 03:21:47 -05:00
parent 90e9dcd06c
commit 81764f0e43

View File

@ -1,5 +1,5 @@
Describe -Tag 'higher', -TestName 'All Higher Tests' { Describe -Tag 'higher', -TestName 'All Higher Tests' {
Describe 'Bool tests' -ForEach @( Describe 'Bool tests' -Tag 'bool' -ForEach @(
@{ Value = $true; Expected = $true } @{ Value = $true; Expected = $true }
@{ Value = $false; Expected = $false } @{ Value = $false; Expected = $false }
) { ) {
@ -97,7 +97,15 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
} }
} }
Context 'Vban instream' -ForEach @( Context 'Vban' {
It 'Should set and get Vban.enable' {
$vmr.vban.enable = $value
$vmr.command.restart
Start-Sleep -Milliseconds 2000
$vmr.vban.enable | Should -Be $expected
}
Context 'Instream' -ForEach @(
@{ Index = $vban_in } @{ Index = $vban_in }
) { ) {
It "Should set vban.instream[$index].on" { It "Should set vban.instream[$index].on" {
@ -106,7 +114,7 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
} }
} }
Context 'Vban outstream' -ForEach @( Context 'Outstream' -ForEach @(
@{ Index = $vban_out } @{ Index = $vban_out }
) { ) {
It "Should set vban.outstream[$index].on" { It "Should set vban.outstream[$index].on" {
@ -114,6 +122,7 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
$vmr.vban.outstream[$index].on | Should -Be $expected $vmr.vban.outstream[$index].on | Should -Be $expected
} }
} }
}
Context 'Recorder' -Skip:$ifBasic { Context 'Recorder' -Skip:$ifBasic {
It 'Should set and get Recorder.A3' { It 'Should set and get Recorder.A3' {
@ -184,20 +193,20 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
It 'Should set and get Option.monitoronsel' -Skip:$ifNotPotato { It 'Should set and get Option.monitoronsel' -Skip:$ifNotPotato {
$vmr.option.monitoronsel = $value $vmr.option.monitoronsel = $value
$vmr.command.restart $vmr.command.restart
Start-Sleep -Milliseconds 500 Start-Sleep -Milliseconds 2000
$vmr.option.monitoronsel | Should -Be $value $vmr.option.monitoronsel | Should -Be $value
} }
It 'Should set and get Option.slidermode' -Skip:$ifNotPotato { It 'Should set and get Option.slidermode' -Skip:$ifNotPotato {
$vmr.option.slidermode = $value $vmr.option.slidermode = $value
$vmr.command.restart $vmr.command.restart
Start-Sleep -Milliseconds 500 Start-Sleep -Milliseconds 2000
$vmr.option.slidermode | Should -Be $value $vmr.option.slidermode | Should -Be $value
} }
} }
} }
Describe 'Float Tests' { Describe 'Float Tests' -Tag 'float' {
Context 'Strip, one physical one virtual' -ForEach @( Context 'Strip, one physical one virtual' -ForEach @(
@{ Index = $phys_in }, @{ Index = $virt_in } @{ Index = $phys_in }, @{ Index = $virt_in }
) { ) {
@ -331,13 +340,13 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
) { ) {
$vmr.option.delay[$phys_out].set($value) $vmr.option.delay[$phys_out].set($value)
$vmr.command.restart $vmr.command.restart
Start-Sleep -Milliseconds 500 Start-Sleep -Milliseconds 2000
$vmr.option.delay[$phys_out].get() | Should -Be $value $vmr.option.delay[$phys_out].get() | Should -Be $value
} }
} }
} }
Describe 'Int Tests' { Describe 'Int Tests' -Tag 'int' {
Context 'Strip, one physical, one virtual' -ForEach @( Context 'Strip, one physical, one virtual' -ForEach @(
@{ Index = $phys_in }, @{ Index = $virt_in } @{ Index = $phys_in }, @{ Index = $virt_in }
) { ) {
@ -406,10 +415,74 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
} }
} }
Context 'Vban outstream' -ForEach @( Context 'Vban' {
It 'Should set vban.port' -ForEach @(
@{ Value = 1024; Expected = 1024 }
@{ Value = 65535; Expected = 65535 }
) {
$vmr.vban.port = $value
$vmr.command.restart
Start-Sleep -Milliseconds 2000
$vmr.vban.port | Should -Be $expected
}
Context 'Instream' -ForEach @(
@{ Index = $vban_in }
) {
It "Should set vban.instream[$index].port" -ForEach @(
@{ Value = 1024; Expected = 1024 }
@{ Value = 65535; Expected = 65535 }
) {
$vmr.vban.instream[$index].port = $value
$vmr.command.restart
Start-Sleep -Milliseconds 2000
$vmr.vban.instream[$index].port | Should -Be $expected
}
It "Should set vban.instream[$index].sr" {
$vmr.vban.instream[$index].sr | Should -BeOfType [int]
}
It "Should set vban.instream[$index].channel" {
$vmr.vban.instream[$index].channel | Should -BeOfType [int]
}
It "Should set vban.instream[$index].bit" {
$vmr.vban.instream[$index].bit | Should -BeOfType [int]
}
It "Should set vban.instream[$index].quality" -ForEach @(
@{ Value = 0; Expected = 0 }
@{ Value = 4; Expected = 4 }
) {
$vmr.vban.instream[$index].quality = $value
Start-Sleep -Milliseconds 500
$vmr.vban.instream[$index].quality | Should -Be $expected
}
It "Should set vban.instream[$index].route" -ForEach @(
@{ Value = $phys_in; Expected = $phys_in }
@{ Value = $virt_in; Expected = $virt_in }
) {
$vmr.vban.instream[$index].route = $value
$vmr.vban.instream[$index].route | Should -Be $expected
}
}
Context 'Outstream' -ForEach @(
@{ Index = $vban_out } @{ Index = $vban_out }
) { ) {
It "Should set vban.outstream[$index].sr to $value" -ForEach @( It "Should set vban.outstream[$index].port" -ForEach @(
@{ Value = 1024; Expected = 1024 }
@{ Value = 65535; Expected = 65535 }
) {
$vmr.vban.outstream[$index].port = $value
$vmr.command.restart
Start-Sleep -Milliseconds 2000
$vmr.vban.outstream[$index].port | Should -Be $expected
}
It "Should set vban.outstream[$index].sr" -ForEach @(
@{ Value = 44100; Expected = 44100 } @{ Value = 44100; Expected = 44100 }
@{ Value = 48000; Expected = 48000 } @{ Value = 48000; Expected = 48000 }
) { ) {
@ -417,13 +490,39 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
$vmr.vban.outstream[$index].sr | Should -Be $expected $vmr.vban.outstream[$index].sr | Should -Be $expected
} }
It 'Should set vban.outstream[0].channel to 1' -ForEach @( It "Should set vban.outstream[$index].channel" -ForEach @(
@{ Value = 1; Expected = 1 } @{ Value = 1; Expected = 1 }
@{ Value = 2; Expected = 2 } @{ Value = 2; Expected = 2 }
) { ) {
$vmr.vban.outstream[$index].channel = $value $vmr.vban.outstream[$index].channel = $value
$vmr.vban.outstream[$index].channel | Should -Be $expected $vmr.vban.outstream[$index].channel | Should -Be $expected
} }
It "Should set vban.outstream[$index].bit" -ForEach @(
@{ Value = 16; Expected = 16 }
@{ Value = 24; Expected = 24 }
) {
$vmr.vban.outstream[$index].bit = $value
$vmr.vban.outstream[$index].bit | Should -Be $expected
}
It "Should set vban.outstream[$index].quality" -ForEach @(
@{ Value = 0; Expected = 0 }
@{ Value = 4; Expected = 4 }
) {
$vmr.vban.outstream[$index].quality = $value
Start-Sleep -Milliseconds 500
$vmr.vban.outstream[$index].quality | Should -Be $expected
}
It "Should set vban.outstream[$index].route" -ForEach @(
@{ Value = $phys_out; Expected = $phys_out }
@{ Value = $virt_out; Expected = $virt_out }
) {
$vmr.vban.outstream[$index].route = $value
$vmr.vban.outstream[$index].route | Should -Be $expected
}
}
} }
Context 'Patch' { Context 'Patch' {
@ -468,7 +567,7 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
} }
} }
Describe 'String Tests' { Describe 'String Tests' -Tag 'string' {
Context 'Strip, one physical, one virtual' -ForEach @( Context 'Strip, one physical, one virtual' -ForEach @(
@{ Index = $phys_in }, @{ Index = $virt_in } @{ Index = $phys_in }, @{ Index = $virt_in }
) { ) {
@ -657,30 +756,44 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
} }
} }
Describe 'Vban' -ForEach @( Describe 'Vban' {
Context 'Instream' -ForEach @(
@{ Index = $vban_in } @{ Index = $vban_in }
) { ) {
Context 'instream' { It "Should set vban.instream[$index].name" -ForEach @(
Context 'ip' -ForEach @( @{ Value = 'TestIn0'; Expected = 'TestIn0' }
@{ Value = 'TestIn1'; Expected = 'TestIn1' }
) {
$vmr.vban.instream[$index].name = $value
$vmr.vban.instream[$index].name | Should -Be $expected
}
It "Should set vban.instream[$index].ip" -ForEach @(
@{ Value = '0.0.0.0'; Expected = '0.0.0.0' } @{ Value = '0.0.0.0'; Expected = '0.0.0.0' }
) { ) {
It "Should set vban.instream[$index].name to $value" {
$vmr.vban.instream[$index].ip = $value $vmr.vban.instream[$index].ip = $value
$vmr.vban.instream[$index].ip | Should -Be $expected $vmr.vban.instream[$index].ip | Should -Be $expected
} }
} }
Context 'Outstream' -ForEach @(
@{ Index = $vban_out }
) {
It "Should set vban.outstream[$index].name" -ForEach @(
@{ Value = 'TestOut0'; Expected = 'TestOut0' }
@{ Value = 'TestOut1'; Expected = 'TestOut1' }
) {
$vmr.vban.outstream[$index].name = $value
$vmr.vban.outstream[$index].name | Should -Be $expected
} }
Context 'outstream' { It "Should set vban.outstream[$index].ip" -ForEach @(
Context 'ip' -ForEach @(
@{ Value = '0.0.0.0'; Expected = '0.0.0.0' } @{ Value = '0.0.0.0'; Expected = '0.0.0.0' }
) { ) {
It "Should set vban.outstream[$index].name to $value" {
$vmr.vban.outstream[$index].ip = $value $vmr.vban.outstream[$index].ip = $value
$vmr.vban.outstream[$index].ip | Should -Be $expected $vmr.vban.outstream[$index].ip | Should -Be $expected
} }
} }
} }
} }
}
} }