You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: topology_options_test.go
    path of file: ./repos/mongo-go-driver/x/mongo/driver/topology
    
    the code of the file until where you have to start completion: // Copyright (C) MongoDB, Inc. 2017-present.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

package topology

import (
	"fmt"
	"net/url"
	"testing"
	"time"

	"go.mongodb.org/mongo-driver/internal/assert"
	"go.mongodb.org/mongo-driver/mongo/options"
)

func TestDirectConnectionFromConnString(t *testing.T) {
	type testCaseQuery [][2]string

	testCases := []struct {
		name  string
		mode  MonitorMode
		query *testCaseQuery
	}{
		{"connect=direct", SingleMode, &testCaseQuery{{"connect", "direct"}}},
		{"connect=automatic", AutomaticMode, &
    
func TestDirectConnectionFromConnString(t *testing.T) {
	type testCaseQuery [][2]string

	testCases := []struct {
		name  string
		mode  MonitorMode
		query *testCaseQuery
	}{
		{"connect=direct", SingleMode, &testCaseQuery{{"connect", "direct"}}},
		{"connect=automatic", AutomaticMode, &testCaseQuery{{"connect", "automatic"}}},
		{"directConnection=true", SingleMode, &testCaseQuery{{"directconnection", "true"}}},
		{"directconnection=false", AutomaticMode, &testCaseQuery{{"directconnection", "false"}}},
		{"default", AutomaticMode, nil},
	}
	for _, tc := range testCases {
		t.Run(tc.name, func(t *testing.T) {
			dns, err := url.Parse("mongodb://localhost/")
			assert.Nil(t, err, "error parsing uri: %v", err)

			if tc.query != nil {
				query := dns.Query()
				for _, q := range *tc.query {
					query.Set(q[0], q[1])
				}
				dns.RawQuery = query.Encode()
			}

			cfg, err := NewConfig(options.Client().ApplyURI(dns.String()), nil)
			assert.Nil(t, err, "error constructing topology config: %v", err)

			topo, err := New(cfg)
			assert.Nil(t, err, "error constructing topology: %v", err)
			assert.Equal(t, tc.mode, topo.cfg.Mode, "expected mode %v, got %v", tc.mode, topo.cfg.Mode)
		})
	}
}