mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-26 21:05:30 +00:00
add test for loading from registry for rest of processors
This commit is contained in:
38
internal/processor/test/free-d-create_test.go
Normal file
38
internal/processor/test/free-d-create_test.go
Normal file
@@ -0,0 +1,38 @@
|
||||
package processor_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/jwetzell/showbridge-go/internal/config"
|
||||
"github.com/jwetzell/showbridge-go/internal/processor"
|
||||
)
|
||||
|
||||
func TestFreeDCreateFromRegistry(t *testing.T) {
|
||||
registration, ok := processor.ProcessorRegistry["freed.create"]
|
||||
if !ok {
|
||||
t.Fatalf("freed.create processor not registered")
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Type: "freed.create",
|
||||
Params: map[string]any{
|
||||
"id": "0",
|
||||
"pan": "0",
|
||||
"tilt": "0",
|
||||
"roll": "0",
|
||||
"posX": "0",
|
||||
"posY": "0",
|
||||
"posZ": "0",
|
||||
"zoom": "0",
|
||||
"focus": "0",
|
||||
},
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create freed.create processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "freed.create" {
|
||||
t.Fatalf("freed.create processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user