aboutsummaryrefslogtreecommitdiffstats
path: root/bug/op_create_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 /bug/op_create_test.go
parenta0dfc202117e31e01d2d6ec701a41292df35d35d (diff)
downloadgit-bug-67a3752e176790e82a48706236f889cab4f8913d.tar.gz
bug,entity: use a dedicated type to store IDs
Diffstat (limited to 'bug/op_create_test.go')
-rw-r--r--bug/op_create_test.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/bug/op_create_test.go b/bug/op_create_test.go
index 20c8ec69..ec53b04b 100644
--- a/bug/op_create_test.go
+++ b/bug/op_create_test.go
@@ -20,11 +20,11 @@ func TestCreate(t *testing.T) {
create.Apply(&snapshot)
- id := create.ID()
- assert.True(t, IDIsValid(id))
+ id := create.Id()
+ assert.NoError(t, id.Validate())
comment := Comment{
- id: string(id),
+ id: id,
Author: rene,
Message: "message",
UnixTime: timestamp.Timestamp(create.UnixTime),
@@ -61,8 +61,9 @@ func TestCreateSerialize(t *testing.T) {
err = json.Unmarshal(data, &after)
assert.NoError(t, err)
- // enforce creating the ID
- before.ID()
+ // enforce creating the IDs
+ before.Id()
+ rene.Id()
assert.Equal(t, before, &after)
}