1
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

26 lines
517 B

package models
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
)
func TestPermissionType_String(t *testing.T) {
testCases := []struct {
permissionType PermissionType
expected string
}{
{PERMISSION_ADMIN, "Admin"},
{PERMISSION_EDIT, "Edit"},
{PERMISSION_VIEW, "View"},
}
for _, tc := range testCases {
t.Run(tc.expected, func(t *testing.T) {
assert.Equal(t, tc.expected, fmt.Sprint(tc.permissionType))
assert.Equal(t, tc.expected, tc.permissionType.String())
})
}
}