Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type TestDB ¶
type TestDB struct { MongoClient *mongo.Client Database mongostorage.StorageReaderWriter }
TestDB defines db client and data access layers.
func NewTestDatabase ¶
func (*TestDB) TruncateCollection ¶
TruncateCollection will remove all documents from a given collection
type TestDBSuite ¶
TestDBSuite defines a suite that can be embedded into other test suites. This provides out of the box capability to plugin DB for test cases. The lifecycle of the DB client is governed by the engulfing suite itself.
func NewTestDBSuite ¶
func NewTestDBSuite(database string) TestDBSuite
NewTestDBSuite creates new test suite for tests dependent on a database
func (*TestDBSuite) DropCollection ¶
func (t *TestDBSuite) DropCollection(collection string)
DropCollection will drop the collection
func (*TestDBSuite) EnforceCollectionSchema ¶
func (t *TestDBSuite) EnforceCollectionSchema(collectionName string, schemaPath string) error
func (*TestDBSuite) SetupSuite ¶
func (t *TestDBSuite) SetupSuite()
SetupSuite sets up the test db suite.
func (*TestDBSuite) TruncateCollection ¶
func (t *TestDBSuite) TruncateCollection(collection string)
TruncateCollection will remove all documents from a given collection
Click to show internal directories.
Click to hide internal directories.