SAP / go-ase

SAP ASE Database Client for Go
Apache License 2.0
25 stars 14 forks source link

Update tests #18

Closed ntnn closed 5 years ago

ntnn commented 5 years ago

Description

Originally the DSNs and connectors were stored as variables and a function returning new sql.DBs based on those variables were called by tests.

To make it easier to add new tests and to remove the boilerplate code a RegisterDSN function is being supplied instead. The RegisterDSN method generates one function (or two if a connector function is passed), which is stored with a name in a map. These functions return a newly created sql.DB. Tests now iterate over this map and call the functions instead.

This makes the tests for different connection more extensible - e.g. to also test against a remote ASE the caller now only registers an additional DSN with the information of the remote ASE, where before more boilerplate code and variables would have to be introduced.

How was the patch tested?

Linter, unit- and integration tests.

CLAassistant commented 5 years ago

CLA assistant check
All committers have signed the CLA.