// New is the entry point for tests.
New is the entry point for tests.
// New is the entry point for tests .
func New() *Test {
	log := log.New(os.Stdout, "TEST : ", log.LstdFlags|log.Lmicroseconds|log.Lshortfile)
	container, err := docker.StartMongo(log)
	if err != nil {
		log.Fatalln(err)
	}
	dbDialTimeout := 25 * time.Second
	dbHost := fmt.Sprintf("mongodb://localhost:%s/gotraining", container.Port)
	log.Println("main : Started : Initialize Mongo")
	masterDB, err := db.New(dbHost, dbDialTimeout)
	if err != nil {
		log.Fatalf("startup : Register DB : %v", err)
	}
	return &Test{log, masterDB, container}
}
func New ( ) * Test { log := log . New ( os . Stdout , " " , log . LstdFlags | log . Lmicroseconds | log . Lshortfile ) container , err := docker . StartMongo ( log ) if err != nil { log . Fatalln ( err ) } dbDialTimeout := 25 * time . Second dbHost := fmt . Sprintf ( " " , container . Port ) log . Println ( " " ) masterDB , err := db . New ( dbHost , dbDialTimeout ) if err != nil { log . Fatalf ( " " , err ) } return & Test { log , masterDB , container } }
New is the entry point for tests.
New is the entry point for tests .
// ========================================================================= // Logging // ============================================================ // Startup Mongo container // ============================================================ // Configuration // ============================================================ // Start Mongo