-
Notifications
You must be signed in to change notification settings - Fork 2
/
remote_test.go
107 lines (100 loc) · 3.07 KB
/
remote_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
package voicemeeter
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestGetBasicRemote(t *testing.T) {
//t.Skip("skipping test")
__rem, _ := NewRemote("basic", 0)
t.Run("Should return a remote basic type", func(t *testing.T) {
assert.NotNil(t, __rem)
})
t.Run("Should equal 'Voicemeeter Basic'", func(t *testing.T) {
assert.Equal(t, "Voicemeeter Basic", __rem.String())
})
t.Run("Should strip length equal 3", func(t *testing.T) {
assert.Equal(t, 3, len(__rem.Strip))
})
t.Run("Should bus length equal 2", func(t *testing.T) {
assert.Equal(t, 2, len(__rem.Bus))
})
t.Run("Should return a valid command pointer", func(t *testing.T) {
assert.NotNil(t, __rem.Command)
})
t.Run("Should return a valid vban pointer", func(t *testing.T) {
assert.NotNil(t, __rem.Vban)
})
t.Run("Should return nil recorder pointer", func(t *testing.T) {
assert.Nil(t, __rem.Recorder)
})
}
func TestGetBananaRemote(t *testing.T) {
//t.Skip("skipping test")
__rem, _ := NewRemote("banana", 0)
t.Run("Should return a remote banana type", func(t *testing.T) {
assert.NotNil(t, __rem)
})
t.Run("Should equal 'Voicemeeter Banana'", func(t *testing.T) {
assert.Equal(t, "Voicemeeter Banana", __rem.String())
})
t.Run("Should strip length equal 5", func(t *testing.T) {
assert.Equal(t, 5, len(__rem.Strip))
})
t.Run("Should bus length equal 5", func(t *testing.T) {
assert.Equal(t, 5, len(__rem.Bus))
})
t.Run("Should return a valid command pointer", func(t *testing.T) {
assert.NotNil(t, __rem.Command)
})
t.Run("Should return a valid vban pointer", func(t *testing.T) {
assert.NotNil(t, __rem.Vban)
})
t.Run("Should return a valid recorder", func(t *testing.T) {
assert.NotNil(t, __rem.Recorder)
})
}
func TestGetPotatoRemote(t *testing.T) {
//t.Skip("skipping test")
__rem, _ := NewRemote("potato", 0)
t.Run("Should return a remote basic type", func(t *testing.T) {
assert.NotNil(t, __rem)
})
t.Run("Should equal 'Voicemeeter Potato'", func(t *testing.T) {
assert.Equal(t, "Voicemeeter Potato", __rem.String())
})
t.Run("Should strip length equal 8", func(t *testing.T) {
assert.Equal(t, 8, len(__rem.Strip))
})
t.Run("Should bus length equal 8", func(t *testing.T) {
assert.Equal(t, 8, len(__rem.Bus))
})
t.Run("Should return a valid command pointer", func(t *testing.T) {
assert.NotNil(t, __rem.Command)
})
t.Run("Should return a valid vban pointer", func(t *testing.T) {
assert.NotNil(t, __rem.Vban)
})
t.Run("Should return a valid recorder", func(t *testing.T) {
assert.NotNil(t, __rem.Recorder)
})
}
func TestSetAndGetFloatParameter(t *testing.T) {
//t.Skip("skipping test")
var param = "strip[0].mute"
var exp = float64(1)
vm.SetFloat(param, 1)
t.Run("Should get a float parameter", func(t *testing.T) {
val, _ := vm.GetFloat(param)
assert.Equal(t, exp, val)
})
}
func TestSetAndGetStringParameter(t *testing.T) {
//t.Skip("skipping test")
var param = "strip[0].label"
var exp = "test0"
vm.SetString(param, exp)
t.Run("Should get a string parameter", func(t *testing.T) {
val, _ := vm.GetString(param)
assert.Equal(t, exp, val)
})
}