Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeDatabase ¶
FakeDatabase provides a minimal in-memory database implementation to use during tests in place of a GORM database.
func NewFakeDatabase ¶
func NewFakeDatabase(t TestObject) *FakeDatabase
NewFakeDatabase instantiates a fake database.
func (*FakeDatabase) CreateTablesFromEntities ¶
func (database *FakeDatabase) CreateTablesFromEntities(t TestObject, tableEntityPointers ...interface{}) *FakeDatabase
CreateTableFromEntity creates new tables in the database using the provided entity pointers.
func (*FakeDatabase) SaveEntities ¶
func (database *FakeDatabase) SaveEntities(t TestObject, entityPointers ...interface{}) *FakeDatabase
SaveEntities takes a collection of entity pointers and saves them to the fake database.
func (*FakeDatabase) SetError ¶
func (database *FakeDatabase) SetError(t TestObject, err error) *FakeDatabase
type TestObject ¶
type TestObject interface { Errorf(format string, args ...interface{}) FailNow() }
TestObject is a minimal interface for interacting with Golang tests.
Click to show internal directories.
Click to hide internal directories.