Add complete unit tests and some results integeration tests