This commit is contained in:
konrad 2018-01-16 14:06:09 +01:00 committed by kolaente
parent a315f71144
commit 547b44d608
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 12 additions and 12 deletions

View File

@ -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)
}
}

View File

@ -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