summaryrefslogtreecommitdiffstatshomepage
path: root/identity/identity_test.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-08-11 14:08:03 +0200
committerMichael Muré <batolettre@gmail.com>2019-08-11 14:08:03 +0200
commit67a3752e176790e82a48706236f889cab4f8913d (patch)
tree113251396fc2569d1db2c2e6fcadb30289b3aa96 /identity/identity_test.go
parenta0dfc202117e31e01d2d6ec701a41292df35d35d (diff)
downloadgit-bug-67a3752e176790e82a48706236f889cab4f8913d.tar.gz
git-bug-67a3752e176790e82a48706236f889cab4f8913d.zip
bug,entity: use a dedicated type to store IDs
Diffstat (limited to 'identity/identity_test.go')
-rw-r--r--identity/identity_test.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/identity/identity_test.go b/identity/identity_test.go
index 2ddb64eab..f91c548f7 100644
--- a/identity/identity_test.go
+++ b/identity/identity_test.go
@@ -4,6 +4,7 @@ import (
"encoding/json"
"testing"
+ "github.com/MichaelMure/git-bug/entity"
"github.com/MichaelMure/git-bug/repository"
"github.com/stretchr/testify/assert"
)
@@ -15,6 +16,7 @@ func TestIdentityCommitLoad(t *testing.T) {
// single version
identity := &Identity{
+ id: entity.UnsetId,
versions: []*Version{
{
name: "René Descartes",
@@ -36,6 +38,7 @@ func TestIdentityCommitLoad(t *testing.T) {
// multiple version
identity = &Identity{
+ id: entity.UnsetId,
versions: []*Version{
{
time: 100,
@@ -114,6 +117,7 @@ func commitsAreSet(t *testing.T, identity *Identity) {
// Test that the correct crypto keys are returned for a given lamport time
func TestIdentity_ValidKeysAtTime(t *testing.T) {
identity := Identity{
+ id: entity.UnsetId,
versions: []*Version{
{
time: 100,
@@ -215,6 +219,7 @@ func TestJSON(t *testing.T) {
mockRepo := repository.NewMockRepoForTest()
identity := &Identity{
+ id: entity.UnsetId,
versions: []*Version{
{
name: "René Descartes",
@@ -223,7 +228,7 @@ func TestJSON(t *testing.T) {
},
}
- // commit to make sure we have an ID
+ // commit to make sure we have an Id
err := identity.Commit(mockRepo)
assert.Nil(t, err)
assert.NotEmpty(t, identity.id)