Improved author unit test
This commit is contained in:
parent
ac78d311a8
commit
64ae3244ed
|
@ -32,7 +32,7 @@ func TestAddOrUpdateAuthor(t *testing.T) {
|
|||
}
|
||||
|
||||
// Get the new author
|
||||
gotauthor, exists, err := GetAuthorByID(1)
|
||||
gotauthor, exists, err := GetAuthorByID(author1.ID)
|
||||
assert.NoError(t, err)
|
||||
assert.True(t, exists)
|
||||
assert.Equal(t, gotauthor.Forename, testauthor.Forename)
|
||||
|
@ -42,7 +42,7 @@ func TestAddOrUpdateAuthor(t *testing.T) {
|
|||
assert.Error(t, err)
|
||||
|
||||
// Update the author
|
||||
testauthor.ID = 1
|
||||
testauthor.ID = author1.ID
|
||||
testauthor.Forename = "Lorem Ipsum"
|
||||
author1updated, err := AddOrUpdateAuthor(testauthor)
|
||||
assert.NoError(t, err)
|
||||
|
|
Loading…
Reference in New Issue