// Copyright 2024 Matthew Rich . 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") } }