From 8a3b8da63513edb9c833edb23b5468f32c4600a4 Mon Sep 17 00:00:00 2001 From: Onyx and Iris <75868496+onyx-and-iris@users.noreply.github.com> Date: Thu, 29 Apr 2021 00:48:16 +0100 Subject: [PATCH] auto login added, tests updated to take $true, $false Added $this.Login() into Remote constructor to automatically log user in. Updated test codes accordingly. Boolean params take $true and $false Updated readme to reflect changes. --- example.ps1 | 19 +-- lib/base.ps1 | 23 ++-- lib/bus.ps1 | 32 ++--- lib/macrobuttons.ps1 | 20 ++- lib/strip.ps1 | 50 ++------ lib/voicemeeter.ps1 | 2 +- test/higher.Tests.ps1 | 288 +++++++++++++++++++++--------------------- test/runall.ps1 | 8 +- 8 files changed, 199 insertions(+), 243 deletions(-) diff --git a/example.ps1 b/example.ps1 index ddb160a..39c7ac8 100644 --- a/example.ps1 +++ b/example.ps1 @@ -3,24 +3,19 @@ try { $vmr = [Remote]::new('potato') - $vmr.Login() - - $vmr.button[0].state = 1 + $vmr.button[0].state = $true $vmr.button[0].state - $vmr.button[0].state = 0 + $vmr.button[0].state = $false $vmr.button[0].state - $vmr.strip[0].mono = 1 + $vmr.strip[0].mono = $true $vmr.strip[0].mono - $vmr.strip[0].mono = 0 + $vmr.strip[0].mono = $false $vmr.strip[0].mono - $vmr.bus[2].mute = 1 + $vmr.bus[2].mute = $true $vmr.bus[2].mute - $vmr.bus[2].mute = 0 + $vmr.bus[2].mute = $false $vmr.bus[2].mute } -finally -{ - $vmr.Logout() -} +finally { $vmr.Logout() } diff --git a/lib/base.ps1 b/lib/base.ps1 index 660880c..cc2b3f3 100644 --- a/lib/base.ps1 +++ b/lib/base.ps1 @@ -52,11 +52,12 @@ Function Param_Set_Multi { $line = $($line -replace '\s+', ' ') $line = $line.TrimEnd() $line = $line -replace '\s', '=' + $line = $line -replace 'True', '1' + $line = $line -replace 'False', '0' $cmd += $line + ';' } [String]$cmd = $cmd.SubString(1) - Write-Host $cmd $retval = $lib::VBVMR_SetParameters($cmd) if($retval) { Throw "ERROR: CAPI return value: $retval" } @@ -165,7 +166,7 @@ Function Login { ) $retval = $lib::VBVMR_Login() if(-not $retval) { Write-Host("LOGGED IN") } - elseif($retval -eq 1) { + elseif($retval -eq 1) { Write-Host("VB NOT RUNNING") if($TYPE -eq 'basic') { @@ -186,7 +187,7 @@ Function Login { $ptr = 0 $retval = $lib::VBVMR_GetVoicemeeterType([ref]$ptr) - if(-not $retval) { + if(-not $retval) { if($ptr -eq 1) { Write-Host("VERSION:[BASIC]") } elseif($ptr -eq 2) { Write-Host("VERSION:[BANANA]") } elseif($ptr -eq 3) { Write-Host("VERSION:[POTATO]") } @@ -219,23 +220,23 @@ if ($MyInvocation.InvocationName -ne '.') Login $hash = @{ - "Strip[0].Mute" = 1 - "Strip[1].Mute" = 1 - "Strip[2].Mute" = 1 - "Strip[0].Mono" = 1 - "Strip[1].Mono" = 1 - "Strip[2].Mono" = 1 + "Strip[0].Mute" = $true + "Strip[1].Mute" = $true + "Strip[2].Mute" = $true + "Strip[0].Mono" = $true + "Strip[1].Mono" = $true + "Strip[2].Mono" = $true } 0..10 | ForEach-Object { foreach($key in $($hash.keys)){ - $hash[$key] = 1 + $hash[$key] = $true } Param_Set_Multi -HASH $hash foreach($key in $($hash.keys)){ - $hash[$key] = 0 + $hash[$key] = $false } Param_Set_Multi -HASH $hash } diff --git a/lib/bus.ps1 b/lib/bus.ps1 index 47e25f7..8dbc4c5 100644 --- a/lib/bus.ps1 +++ b/lib/bus.ps1 @@ -21,11 +21,9 @@ class Bus { hidden $_mono = $($this | Add-Member ScriptProperty 'mono' ` { - # get $this.Getter($this.cmd('Mono')) }` { - # set param ( [Single]$arg ) $this._mono = $this.Setter($this.cmd('Mono'), $arg) } @@ -33,11 +31,9 @@ class Bus { hidden $_mute = $($this | Add-Member ScriptProperty 'mute' ` { - # get $this.Getter($this.cmd('Mute')) }` { - # set param ( [Single]$arg ) $this._mute = $this.Setter($this.cmd('Mute'), $arg) } @@ -45,11 +41,9 @@ class Bus { hidden $_gain = $($this | Add-Member ScriptProperty 'gain' ` { - # get $this.Getter($this.cmd('gain')) }` { - # set param ( [Single]$arg ) $this._gain = $this.Setter($this.cmd('gain'), $arg) } @@ -67,20 +61,18 @@ Function Buses { if ($MyInvocation.InvocationName -ne '.') { . .\voicemeeter.ps1 + try { + $vmr = [Remote]::new('potato') - $vmr = [Remote]::new('potato') + $vmr.bus[0].mono = $true + $vmr.bus[0].mono + $vmr.bus[0].mono = $false + $vmr.bus[0].mono - $vmr.Login() - - $vmr.bus[0].mono = 1 - $vmr.bus[0].mono - $vmr.bus[0].mono = 0 - $vmr.bus[0].mono - - $vmr.bus[1].gain = 3.2 - $vmr.bus[1].gain - $vmr.bus[2].gain = -2.0 - $vmr.bus[2].gain - - $vmr.Logout() + $vmr.bus[1].gain = 3.2 + $vmr.bus[1].gain + $vmr.bus[2].gain = -2.0 + $vmr.bus[2].gain + } + finally { $vmr.Logout() } } diff --git a/lib/macrobuttons.ps1 b/lib/macrobuttons.ps1 index 8da86af..ec41954 100644 --- a/lib/macrobuttons.ps1 +++ b/lib/macrobuttons.ps1 @@ -63,17 +63,13 @@ Function Buttons { if ($MyInvocation.InvocationName -ne '.') { . .\voicemeeter.ps1 + try { + $vmr = [Remote]::new('potato') - $vmr = [Remote]::new('potato') - - $vmr.Login() - - $vmr.button = Buttons - - $vmr.button[0].state = 1 - $vmr.button[0].state - $vmr.button[0].state = 0 - $vmr.button[0].state - - $vmr.Logout() + $vmr.button[0].state = $true + $vmr.button[0].state + $vmr.button[0].state = $false + $vmr.button[0].state + } + finally { $vmr.Logout() } } diff --git a/lib/strip.ps1 b/lib/strip.ps1 index bc9f338..c5a10ef 100644 --- a/lib/strip.ps1 +++ b/lib/strip.ps1 @@ -21,11 +21,9 @@ class Strip { hidden $_mono = $($this | Add-Member ScriptProperty 'mono' ` { - # get $this.Getter($this.cmd('Mono')) }` { - # set param ( [Single]$arg ) $this._mono = $this.Setter($this.cmd('Mono'), $arg) } @@ -33,11 +31,9 @@ class Strip { hidden $_solo = $($this | Add-Member ScriptProperty 'solo' ` { - # get $this.Getter($this.cmd('Solo')) }` { - # set param ( [Single]$arg ) $this._solo = $this.Setter($this.cmd('Solo'), $arg) } @@ -45,11 +41,9 @@ class Strip { hidden $_mute = $($this | Add-Member ScriptProperty 'mute' ` { - # get $this.Getter($this.cmd('Mute')) }` { - # set param ( [Single]$arg ) $this._mute = $this.Setter($this.cmd('Mute'), $arg) } @@ -57,11 +51,9 @@ class Strip { hidden $_A1 = $($this | Add-Member ScriptProperty 'A1' ` { - # get $this.Getter($this.cmd('A1')) }` { - # set param ( [Single]$arg ) $this._A1 = $this.Setter($this.cmd('A1'), $arg) } @@ -69,11 +61,9 @@ class Strip { hidden $_A2 = $($this | Add-Member ScriptProperty 'A2' ` { - # get $this.Getter($this.cmd('A2')) }` { - # set param ( [Single]$arg ) $this._A2 = $this.Setter($this.cmd('A2'), $arg) } @@ -81,11 +71,9 @@ class Strip { hidden $_A3 = $($this | Add-Member ScriptProperty 'A3' ` { - # get $this.Getter($this.cmd('A3')) }` { - # set param ( [Single]$arg ) $this._A3 = $this.Setter($this.cmd('A3'), $arg) } @@ -93,11 +81,9 @@ class Strip { hidden $_A4 = $($this | Add-Member ScriptProperty 'A4' ` { - # get $this.Getter($this.cmd('A4')) }` { - # set param ( [Single]$arg ) $this._A4 = $this.Setter($this.cmd('A4'), $arg) } @@ -105,11 +91,9 @@ class Strip { hidden $_A5 = $($this | Add-Member ScriptProperty 'A5' ` { - # get $this.Getter($this.cmd('A5')) }` { - # set param ( [Single]$arg ) $this._A5 = $this.Setter($this.cmd('A5'), $arg) } @@ -117,11 +101,9 @@ class Strip { hidden $_B1 = $($this | Add-Member ScriptProperty 'B1' ` { - # get $this.Getter($this.cmd('B1')) }` { - # set param ( [Single]$arg ) $this._B1 = $this.Setter($this.cmd('B1'), $arg) } @@ -129,11 +111,9 @@ class Strip { hidden $_B2 = $($this | Add-Member ScriptProperty 'B2' ` { - # get $this.Getter($this.cmd('B2')) }` { - # set param ( [Single]$arg ) $this._B2 = $this.Setter($this.cmd('B2'), $arg) } @@ -141,11 +121,9 @@ class Strip { hidden $_B3 = $($this | Add-Member ScriptProperty 'B3' ` { - # get $this.Getter($this.cmd('B3')) }` { - # set param ( [Single]$arg ) $this._B3 = $this.Setter($this.cmd('B3'), $arg) } @@ -153,11 +131,9 @@ class Strip { hidden $_gain = $($this | Add-Member ScriptProperty 'gain' ` { - # get $this.Getter($this.cmd('gain')) }` { - # set param ( [Single]$arg ) $this._gain = $this.Setter($this.cmd('gain'), $arg) } @@ -175,21 +151,19 @@ Function Strips { if ($MyInvocation.InvocationName -ne '.') { . .\voicemeeter.ps1 + try { + $vmr = [Remote]::new('potato') - $vmr = [Remote]::new('potato') - - $vmr.Login() - - $vmr.strip[1].A1 = 1 - $vmr.strip[1].A1 - $vmr.strip[2].A2 = 0 - $vmr.strip[2].A2 + $vmr.strip[1].A1 = $true + $vmr.strip[1].A1 + $vmr.strip[2].A2 = $false + $vmr.strip[2].A2 - $vmr.strip[1].gain = 3.2 - $vmr.strip[1].gain - $vmr.strip[2].gain = -2.0 - $vmr.strip[2].gain - - $vmr.Logout() + $vmr.strip[1].gain = 3.2 + $vmr.strip[1].gain + $vmr.strip[2].gain = -2.0 + $vmr.strip[2].gain + } + finally { $vmr.Logout() } } diff --git a/lib/voicemeeter.ps1 b/lib/voicemeeter.ps1 index be1f25c..82e7e94 100644 --- a/lib/voicemeeter.ps1 +++ b/lib/voicemeeter.ps1 @@ -10,6 +10,7 @@ class Remote { Remote ([String]$type) { $this.type = $type + $this.Login() } [void] Login () { @@ -24,4 +25,3 @@ class Remote { Logout } } - diff --git a/test/higher.Tests.ps1 b/test/higher.Tests.ps1 index f1a9013..6c1001b 100644 --- a/test/higher.Tests.ps1 +++ b/test/higher.Tests.ps1 @@ -2,97 +2,97 @@ Describe -Tag 'higher', -TestName 'All Alias Tests' { Describe 'Macrobutton Tests' { Context 'mode = State' { It 'Should set macrobutton[0] State to 1' { - $vmr.button[0].state = 1 - $vmr.button[0].state | Should -Be 1 + $vmr.button[0].state = $true + $vmr.button[0].state | Should -Be $true } It 'Should set macrobutton[0] State to 0' { - $vmr.button[0].state = 0 - $vmr.button[0].state | Should -Be 0 + $vmr.button[0].state = $false + $vmr.button[0].state | Should -Be $false } It 'Should set macrobutton[1] State to 1' { - $vmr.button[1].state = 1 - $vmr.button[1].state | Should -Be 1 + $vmr.button[1].state = $true + $vmr.button[1].state | Should -Be $true } It 'Should set macrobutton[1] State to 0' { - $vmr.button[1].state = 0 - $vmr.button[1].state | Should -Be 0 + $vmr.button[1].state = $false + $vmr.button[1].state | Should -Be $false } It 'Should set macrobutton[2] State to 1' { - $vmr.button[2].state = 1 - $vmr.button[2].state | Should -Be 1 + $vmr.button[2].state = $true + $vmr.button[2].state | Should -Be $true } It 'Should set macrobutton[2] State to 0' { - $vmr.button[2].state = 0 - $vmr.button[2].state | Should -Be 0 + $vmr.button[2].state = $false + $vmr.button[2].state | Should -Be $false } } Context 'mode = StateOnly' { It 'Should set macrobutton[0] StateOnly to 1' { - $vmr.button[0].stateonly = 1 - $vmr.button[0].stateonly | Should -Be 1 + $vmr.button[0].stateonly = $true + $vmr.button[0].stateonly | Should -Be $true } It 'Should set macrobutton[0] StateOnly to 0' { - $vmr.button[0].stateonly = 0 - $vmr.button[0].stateonly | Should -Be 0 + $vmr.button[0].stateonly = $false + $vmr.button[0].stateonly | Should -Be $false } It 'Should set macrobutton[1] StateOnly to 1' { - $vmr.button[1].stateonly = 1 - $vmr.button[1].stateonly | Should -Be 1 + $vmr.button[1].stateonly = $true + $vmr.button[1].stateonly | Should -Be $true } It 'Should set macrobutton[1] StateOnly to 0' { - $vmr.button[1].stateonly = 0 - $vmr.button[1].stateonly | Should -Be 0 + $vmr.button[1].stateonly = $false + $vmr.button[1].stateonly | Should -Be $false } It 'Should set macrobutton[2] StateOnly to 1' { - $vmr.button[2].stateonly = 1 - $vmr.button[2].stateonly | Should -Be 1 + $vmr.button[2].stateonly = $true + $vmr.button[2].stateonly | Should -Be $true } It 'Should set macrobutton[2] StateOnly to 0' { - $vmr.button[2].stateonly = 0 - $vmr.button[2].stateonly | Should -Be 0 + $vmr.button[2].stateonly = $false + $vmr.button[2].stateonly | Should -Be $false } } Context 'mode = Trigger' { It 'Should set macrobutton[0] Trigger to 1' { - $vmr.button[0].trigger = 1 - $vmr.button[0].trigger | Should -Be 1 + $vmr.button[0].trigger = $true + $vmr.button[0].trigger | Should -Be $true } It 'Should set macrobutton[0] Trigger to 0' { - $vmr.button[0].trigger = 0 - $vmr.button[0].trigger | Should -Be 0 + $vmr.button[0].trigger = $false + $vmr.button[0].trigger | Should -Be $false } It 'Should set macrobutton[1] Trigger to 1' { - $vmr.button[1].trigger = 1 - $vmr.button[1].trigger | Should -Be 1 + $vmr.button[1].trigger = $true + $vmr.button[1].trigger | Should -Be $true } It 'Should set macrobutton[1] Trigger to 0' { - $vmr.button[1].trigger = 0 - $vmr.button[1].trigger | Should -Be 0 + $vmr.button[1].trigger = $false + $vmr.button[1].trigger | Should -Be $false } It 'Should set macrobutton[2] Trigger to 1' { - $vmr.button[2].trigger = 1 - $vmr.button[2].trigger | Should -Be 1 + $vmr.button[2].trigger = $true + $vmr.button[2].trigger | Should -Be $true } It 'Should set macrobutton[2] Trigger to 0' { - $vmr.button[2].trigger = 0 - $vmr.button[2].trigger | Should -Be 0 + $vmr.button[2].trigger = $false + $vmr.button[2].trigger | Should -Be $false } } } @@ -100,289 +100,289 @@ Describe -Tag 'higher', -TestName 'All Alias Tests' { Describe 'Set and Get Param Float Tests' { Context 'Strip[i].Mute' { It 'Should set Strip[0].Mute to 1' { - $vmr.strip[0].mute = 1 - $vmr.strip[0].mute | Should -Be 1 + $vmr.strip[0].mute = $true + $vmr.strip[0].mute | Should -Be $true } It 'Should set Strip[0].Mute to 0' { - $vmr.strip[0].mute = 0 - $vmr.strip[0].mute | Should -Be 0 + $vmr.strip[0].mute = $false + $vmr.strip[0].mute | Should -Be $false } It 'Should set Strip[1].Mute to 1' { - $vmr.strip[1].mute = 1 - $vmr.strip[1].mute | Should -Be 1 + $vmr.strip[1].mute = $true + $vmr.strip[1].mute | Should -Be $true } It 'Should set Strip[1].Mute to 0' { - $vmr.strip[1].mute = 0 - $vmr.strip[1].mute | Should -Be 0 + $vmr.strip[1].mute = $false + $vmr.strip[1].mute | Should -Be $false } It 'Should set Strip[2].Mute to 1' { - $vmr.strip[2].mute = 1 - $vmr.strip[2].mute | Should -Be 1 + $vmr.strip[2].mute = $true + $vmr.strip[2].mute | Should -Be $true } It 'Should set Strip[2].Mute to 0' { - $vmr.strip[2].mute = 0 - $vmr.strip[2].mute | Should -Be 0 + $vmr.strip[2].mute = $false + $vmr.strip[2].mute | Should -Be $false } } Context 'Strip[i].Solo' { It 'Should set Strip[0].Solo to 1' { - $vmr.strip[0].solo = 1 - $vmr.strip[0].solo | Should -Be 1 + $vmr.strip[0].solo = $true + $vmr.strip[0].solo | Should -Be $true } It 'Should set Strip[0].Solo to 0' { - $vmr.strip[0].solo = 0 - $vmr.strip[0].solo | Should -Be 0 + $vmr.strip[0].solo = $false + $vmr.strip[0].solo | Should -Be $false } It 'Should set Strip[1].Solo to 1' { - $vmr.strip[1].solo = 1 - $vmr.strip[1].solo | Should -Be 1 + $vmr.strip[1].solo = $true + $vmr.strip[1].solo | Should -Be $true } It 'Should set Strip[1].Solo to 0' { - $vmr.strip[1].solo = 0 - $vmr.strip[1].solo | Should -Be 0 + $vmr.strip[1].solo = $false + $vmr.strip[1].solo | Should -Be $false } It 'Should set Strip[2].Solo to 1' { - $vmr.strip[2].solo = 1 - $vmr.strip[2].solo | Should -Be 1 + $vmr.strip[2].solo = $true + $vmr.strip[2].solo | Should -Be $true } It 'Should set Strip[2].Solo to 0' { - $vmr.strip[2].solo = 0 - $vmr.strip[2].solo | Should -Be 0 + $vmr.strip[2].solo = $false + $vmr.strip[2].solo | Should -Be $false } } Context 'Strip[i].Mono' { It 'Should set Strip[0].Mono to 1' { - $vmr.strip[0].mono = 1 - $vmr.strip[0].mono | Should -Be 1 + $vmr.strip[0].mono = $true + $vmr.strip[0].mono | Should -Be $true } It 'Should set Strip[0].Mono to 0' { - $vmr.strip[0].mono = 0 - $vmr.strip[0].mono | Should -Be 0 + $vmr.strip[0].mono = $false + $vmr.strip[0].mono | Should -Be $false } It 'Should set Strip[1].Mono to 1' { - $vmr.strip[1].mono = 1 - $vmr.strip[1].mono | Should -Be 1 + $vmr.strip[1].mono = $true + $vmr.strip[1].mono | Should -Be $true } It 'Should set Strip[1].Mono to 0' { - $vmr.strip[1].mono = 0 - $vmr.strip[1].mono | Should -Be 0 + $vmr.strip[1].mono = $false + $vmr.strip[1].mono | Should -Be $false } It 'Should set Strip[2].Mono to 1' { - $vmr.strip[2].mono = 1 - $vmr.strip[2].mono | Should -Be 1 + $vmr.strip[2].mono = $true + $vmr.strip[2].mono | Should -Be $true } It 'Should set Strip[2].Mono to 0' { - $vmr.strip[2].mono = 0 - $vmr.strip[2].mono | Should -Be 0 + $vmr.strip[2].mono = $false + $vmr.strip[2].mono | Should -Be $false } } Context 'Strip[i].A1' { It 'Should set Strip[0].A1 to 1' { - $vmr.strip[0].A1 = 1 - $vmr.strip[0].A1 | Should -Be 1 + $vmr.strip[0].A1 = $true + $vmr.strip[0].A1 | Should -Be $true } It 'Should set Strip[0].A1 to 0' { - $vmr.strip[0].A1 = 0 - $vmr.strip[0].A1 | Should -Be 0 + $vmr.strip[0].A1 = $false + $vmr.strip[0].A1 | Should -Be $false } It 'Should set Strip[1].A1 to 1' { - $vmr.strip[1].A1 = 1 - $vmr.strip[1].A1 | Should -Be 1 + $vmr.strip[1].A1 = $true + $vmr.strip[1].A1 | Should -Be $true } It 'Should set Strip[1].A1 to 0' { - $vmr.strip[1].A1 = 0 - $vmr.strip[1].A1 | Should -Be 0 + $vmr.strip[1].A1 = $false + $vmr.strip[1].A1 | Should -Be $false } It 'Should set Strip[2].A1 to 1' { - $vmr.strip[2].A1 = 1 - $vmr.strip[2].A1 | Should -Be 1 + $vmr.strip[2].A1 = $true + $vmr.strip[2].A1 | Should -Be $true } It 'Should set Strip[2].A1 to 0' { - $vmr.strip[2].A1 = 0 - $vmr.strip[2].A1 | Should -Be 0 + $vmr.strip[2].A1 = $false + $vmr.strip[2].A1 | Should -Be $false } } Context 'Strip[i].A2' { It 'Should set Strip[0].A2 to 1' { - $vmr.strip[0].A2 = 1 - $vmr.strip[0].A2 | Should -Be 1 + $vmr.strip[0].A2 = $true + $vmr.strip[0].A2 | Should -Be $true } It 'Should set Strip[0].v to 0' { - $vmr.strip[0].A2 = 0 - $vmr.strip[0].A2 | Should -Be 0 + $vmr.strip[0].A2 = $false + $vmr.strip[0].A2 | Should -Be $false } It 'Should set Strip[1].A2 to 1' { - $vmr.strip[1].A2 = 1 - $vmr.strip[1].A2 | Should -Be 1 + $vmr.strip[1].A2 = $true + $vmr.strip[1].A2 | Should -Be $true } It 'Should set Strip[1].A2 to 0' { - $vmr.strip[1].A2 = 0 - $vmr.strip[1].A2 | Should -Be 0 + $vmr.strip[1].A2 = $false + $vmr.strip[1].A2 | Should -Be $false } It 'Should set Strip[2].A2 to 1' { - $vmr.strip[2].A2 = 1 - $vmr.strip[2].A2 | Should -Be 1 + $vmr.strip[2].A2 = $true + $vmr.strip[2].A2 | Should -Be $true } It 'Should set Strip[2].A2 to 0' { - $vmr.strip[2].A2 = 0 - $vmr.strip[2].A2 | Should -Be 0 + $vmr.strip[2].A2 = $false + $vmr.strip[2].A2 | Should -Be $false } } Context 'Strip[i].A3' { It 'Should set Strip[0].A3 to 1' { - $vmr.strip[0].A3 = 1 - $vmr.strip[0].A3 | Should -Be 1 + $vmr.strip[0].A3 = $true + $vmr.strip[0].A3 | Should -Be $true } It 'Should set Strip[0].A3 to 0' { - $vmr.strip[0].A3 = 0 - $vmr.strip[0].A3 | Should -Be 0 + $vmr.strip[0].A3 = $false + $vmr.strip[0].A3 | Should -Be $false } It 'Should set Strip[1].A3 to 1' { - $vmr.strip[1].A3 = 1 - $vmr.strip[1].A3 | Should -Be 1 + $vmr.strip[1].A3 = $true + $vmr.strip[1].A3 | Should -Be $true } It 'Should set Strip[1].A3 to 0' { - $vmr.strip[1].A3 = 0 - $vmr.strip[1].A3 | Should -Be 0 + $vmr.strip[1].A3 = $false + $vmr.strip[1].A3 | Should -Be $false } It 'Should set Strip[2].A3 to 1' { - $vmr.strip[2].A3 = 1 - $vmr.strip[2].A3 | Should -Be 1 + $vmr.strip[2].A3 = $true + $vmr.strip[2].A3 | Should -Be $true } It 'Should set Strip[2].A3 to 0' { - $vmr.strip[2].A3 = 0 - $vmr.strip[2].A3 | Should -Be 0 + $vmr.strip[2].A3 = $false + $vmr.strip[2].A3 | Should -Be $false } } Context 'Strip[i].B1' { It 'Should set Strip[0].B1 to 1' { - $vmr.strip[0].B1 = 1 - $vmr.strip[0].B1 | Should -Be 1 + $vmr.strip[0].B1 = $true + $vmr.strip[0].B1 | Should -Be $true } It 'Should set Strip[0].B1 to 0' { - $vmr.strip[0].B1 = 0 - $vmr.strip[0].B1 | Should -Be 0 + $vmr.strip[0].B1 = $false + $vmr.strip[0].B1 | Should -Be $false } It 'Should set Strip[1].B1 to 1' { - $vmr.strip[1].B1 = 1 - $vmr.strip[1].B1 | Should -Be 1 + $vmr.strip[1].B1 = $true + $vmr.strip[1].B1 | Should -Be $true } It 'Should set Strip[1].B1 to 0' { - $vmr.strip[1].B1 = 0 - $vmr.strip[1].B1 | Should -Be 0 + $vmr.strip[1].B1 = $false + $vmr.strip[1].B1 | Should -Be $false } It 'Should set Strip[2].B1 to 1' { - $vmr.strip[2].B1 = 1 - $vmr.strip[2].B1 | Should -Be 1 + $vmr.strip[2].B1 = $true + $vmr.strip[2].B1 | Should -Be $true } It 'Should set Strip[2].B1 to 0' { - $vmr.strip[2].B1 = 0 - $vmr.strip[2].B1 | Should -Be 0 + $vmr.strip[2].B1 = $false + $vmr.strip[2].B1 | Should -Be $false } } Context 'Strip[i].B2' { It 'Should set Strip[0].B2 to 1' { - $vmr.strip[0].B2 = 1 - $vmr.strip[0].B2 | Should -Be 1 + $vmr.strip[0].B2 = $true + $vmr.strip[0].B2 | Should -Be $true } It 'Should set Strip[0].B2 to 0' { - $vmr.strip[0].B2 = 0 - $vmr.strip[0].B2 | Should -Be 0 + $vmr.strip[0].B2 = $false + $vmr.strip[0].B2 | Should -Be $false } It 'Should set Strip[1].B2 to 1' { - $vmr.strip[1].B2 = 1 - $vmr.strip[1].B2 | Should -Be 1 + $vmr.strip[1].B2 = $true + $vmr.strip[1].B2 | Should -Be $true } It 'Should set Strip[1].B2 to 0' { - $vmr.strip[1].B2 = 0 - $vmr.strip[1].B2 | Should -Be 0 + $vmr.strip[1].B2 = $false + $vmr.strip[1].B2 | Should -Be $false } It 'Should set Strip[2].B2 to 1' { - $vmr.strip[2].B2 = 1 - $vmr.strip[2].B2 | Should -Be 1 + $vmr.strip[2].B2 = $true + $vmr.strip[2].B2 | Should -Be $true } It 'Should set Strip[2].B2 to 0' { - $vmr.strip[2].B2 = 0 - $vmr.strip[2].B2 | Should -Be 0 + $vmr.strip[2].B2 = $false + $vmr.strip[2].B2 | Should -Be $false } } Context 'Strip[i].B3' { It 'Should set Strip[0].B3 to 1' { - $vmr.strip[0].B3 = 1 - $vmr.strip[0].B3 | Should -Be 1 + $vmr.strip[0].B3 = $true + $vmr.strip[0].B3 | Should -Be $true } It 'Should set Strip[0].B3 to 0' { - $vmr.strip[0].B3 = 0 - $vmr.strip[0].B3 | Should -Be 0 + $vmr.strip[0].B3 = $false + $vmr.strip[0].B3 | Should -Be $false } It 'Should set Strip[1].B3 to 1' { - $vmr.strip[1].B3 = 1 - $vmr.strip[1].B3 | Should -Be 1 + $vmr.strip[1].B3 = $true + $vmr.strip[1].B3 | Should -Be $true } It 'Should set Strip[1].B3 to 0' { - $vmr.strip[1].B3 = 0 - $vmr.strip[1].B3 | Should -Be 0 + $vmr.strip[1].B3 = $false + $vmr.strip[1].B3 | Should -Be $false } It 'Should set Strip[2].B3 to 1' { - $vmr.strip[2].B3 = 1 - $vmr.strip[2].B3 | Should -Be 1 + $vmr.strip[2].B3 = $true + $vmr.strip[2].B3 | Should -Be $true } It 'Should set Strip[2].B3 to 0' { - $vmr.strip[2].B3 = 0 - $vmr.strip[2].B3 | Should -Be 0 + $vmr.strip[2].B3 = $false + $vmr.strip[2].B3 | Should -Be $false } } } diff --git a/test/runall.ps1 b/test/runall.ps1 index 7ec0530..bab4b68 100644 --- a/test/runall.ps1 +++ b/test/runall.ps1 @@ -6,13 +6,11 @@ try { . ..\lib\voicemeeter.ps1 - $vmr = [Remote]::new('banana') + $vmr = [Remote]::new('potato') - $vmr.Login() - - 1..$num | ForEach-Object { + 1..$num | ForEach-Object { Write-Host "Running test $_ of $num" - Invoke-Pester -Tag $tag + Invoke-Pester -Tag $tag } } finally