INNER CODE UNIT · Go
TestCollection_e2e_Creator
chenmingyong0423/go-mongox · collection_e2e_test.go:55
func TestCollection_e2e_Creator(t *testing.T) {
collection := getCollection[any](t)
c := creator.NewCreator[any](collection.collection, nil, nil)
assert.NotNil(t, c, "Expected non-nil Creator")
}
func TestCollection_e2e_New(t *testing.T) {
assert.NotNil(t, getCollection[any](t))
}
func getCollection[T any](t *testing.T) *Collection[T] {
client, err := mongo.Connect(options.Client().ApplyURI("mongodb://localhost:27017").SetAuth(options.Credential{
Username: "test",
Password: "test",
AuthSource: "db-test",
}))
assert.NoError(t, err)