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
645 B
26 lines
645 B
package idgen
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestNewGenerator(t *testing.T) {
|
|
gen := NewGenerator()
|
|
assert.NotNil(t, gen, "Generator should not be nil")
|
|
}
|
|
|
|
func TestGenerateMachineID(t *testing.T) {
|
|
gen := NewGenerator()
|
|
id, err := gen.GenerateMachineID()
|
|
assert.NoError(t, err, "Should not return an error")
|
|
assert.NotEmpty(t, id, "Generated machine ID should not be empty")
|
|
}
|
|
|
|
func TestGenerateDeviceID(t *testing.T) {
|
|
gen := NewGenerator()
|
|
id, err := gen.GenerateDeviceID()
|
|
assert.NoError(t, err, "Should not return an error")
|
|
assert.NotEmpty(t, id, "Generated device ID should not be empty")
|
|
}
|