Unit tests: added folders connection assert and some refactroing