goft
This commit is contained in:
parent
a315f71144
commit
547b44d608
|
@ -1,8 +1,8 @@
|
|||
package models
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestAddOrUpdateBook(t *testing.T) {
|
||||
|
@ -10,19 +10,19 @@ func TestAddOrUpdateBook(t *testing.T) {
|
|||
assert.NoError(t, PrepareTestDatabase())
|
||||
|
||||
// Create a new author for testing purposes
|
||||
testauthor1 := Author{Forename:"Testauthor wich", Lastname: "already exists"}
|
||||
testauthor1 := Author{Forename: "Testauthor wich", Lastname: "already exists"}
|
||||
testauthorin1, err := AddOrUpdateAuthor(testauthor1)
|
||||
assert.NoError(t, err)
|
||||
|
||||
// Bootstrap our test book
|
||||
testbook := Book{
|
||||
Title: "Test",
|
||||
Title: "Test",
|
||||
Description: "Lorem Ipsum",
|
||||
Isbn: "9999999999-999-99",
|
||||
Year: 2018,
|
||||
Price: 9.99,
|
||||
Status: 0,
|
||||
Quantity: 10,
|
||||
Isbn: "9999999999-999-99",
|
||||
Year: 2018,
|
||||
Price: 9.99,
|
||||
Status: 0,
|
||||
Quantity: 10,
|
||||
|
||||
Publisher: Publisher{
|
||||
Name: "TestPublisherWhich does not exist",
|
||||
|
@ -104,4 +104,4 @@ func TestAddOrUpdateBook(t *testing.T) {
|
|||
_, exists, err = GetBookByID(1)
|
||||
assert.NoError(t, err)
|
||||
assert.False(t, exists)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,10 +11,10 @@ func TestAddOrUpdateItem(t *testing.T) {
|
|||
|
||||
// Bootstrap our test item
|
||||
testitem := Item{
|
||||
Title:"Testitem",
|
||||
Price:9.999,
|
||||
Title: "Testitem",
|
||||
Price: 9.999,
|
||||
Description: "Lorem Ipsum",
|
||||
Other: "bs",
|
||||
Other: "bs",
|
||||
}
|
||||
|
||||
// Create a new item
|
||||
|
|
Loading…
Reference in New Issue