1package gpg 2 3import ( 4 "testing" 5 "time" 6 7 "github.com/stretchr/testify/assert" 8) 9 10func TestIdentity(t *testing.T) { 11 id := Identity{ 12 Name: "John Doe", 13 Comment: "johnny", 14 Email: "john.doe@example.org", 15 CreationDate: time.Now(), 16 ExpirationDate: time.Now().Add(time.Hour), 17 } 18 19 assert.Equal(t, id.ID(), "John Doe (johnny) <john.doe@example.org>") 20 assert.Equal(t, id.String(), "uid "+id.ID()) 21} 22