machine/model_test.go
Matthew Rich 85e39191b8
Some checks failed
Lint / golangci-lint (push) Failing after 9m53s
Machine Tests / test (push) Successful in 40s
fix lint errors
2024-04-04 13:08:50 -07:00

30 lines
580 B
Go

// Copyright 2024 Matthew Rich <matthewrich.conf@gmail.com>. All rights reserved.
package machine
import (
"testing"
)
func setupModel(initial State) Modeler {
return NewModel(initial)
}
func TestMachineModel(t *testing.T) {
m := setupModel("")
if m == nil {
t.Errorf("Failed creating new model")
}
}
func TestMachineModelChangeState(t *testing.T) {
m := setupModel("")
oldState := m.ChangeState("connected")
if oldState != "" {
t.Errorf("Failed changing state in model")
}
if m.InspectState() != "connected" {
t.Errorf("Failed changing state in model")
}
}