github.com/jordan-bonecutter/can-go@v0.0.0-20230901155856-d83995b18e50/pkg/dbc/objecttype_test.go (about)

     1  package dbc
     2  
     3  import (
     4  	"testing"
     5  
     6  	"gotest.tools/v3/assert"
     7  )
     8  
     9  func TestObjectType_Validate(t *testing.T) {
    10  	for _, tt := range []ObjectType{
    11  		ObjectTypeUnspecified,
    12  		ObjectTypeNetworkNode,
    13  		ObjectTypeMessage,
    14  		ObjectTypeSignal,
    15  		ObjectTypeEnvironmentVariable,
    16  	} {
    17  		assert.NilError(t, tt.Validate())
    18  	}
    19  }
    20  
    21  func TestObjectType_Validate_Error(t *testing.T) {
    22  	assert.ErrorContains(t, ObjectType("foo").Validate(), "invalid object type")
    23  }