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
|
// Get the new author
|
||||||
gotauthor, exists, err := GetAuthorByID(1)
|
gotauthor, exists, err := GetAuthorByID(author1.ID)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.True(t, exists)
|
assert.True(t, exists)
|
||||||
assert.Equal(t, gotauthor.Forename, testauthor.Forename)
|
assert.Equal(t, gotauthor.Forename, testauthor.Forename)
|
||||||
|
@ -42,7 +42,7 @@ func TestAddOrUpdateAuthor(t *testing.T) {
|
||||||
assert.Error(t, err)
|
assert.Error(t, err)
|
||||||
|
|
||||||
// Update the author
|
// Update the author
|
||||||
testauthor.ID = 1
|
testauthor.ID = author1.ID
|
||||||
testauthor.Forename = "Lorem Ipsum"
|
testauthor.Forename = "Lorem Ipsum"
|
||||||
author1updated, err := AddOrUpdateAuthor(testauthor)
|
author1updated, err := AddOrUpdateAuthor(testauthor)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
Loading…
Reference in New Issue