I wrote a class creating connection to a remote database, query and do some more actions on that. Which is the best way/ strategy to test that kind of class? I tried to mock third party functions creating connection but I don't think it is the right way. Any help is appreciated. If you need more info, let me know.
To test something like this you want your test to not care whether it's connecting to the actual remote database or to a mock database that you manage yourself. It can be an actual, if lightweight, database or a coded representation of one. As long as the class you want to test does not use hard-coded values to connect, you should be able to do this.
The important thing is that the method you choose works for your purposes. Depending on what you need your class to do, using it in an application with extensive logging may be sufficient.