Added unit tests rewritten from the scratch (prior to latest refactorizations)