Issue refs #1307: major part of the tests implemented
Issue refs #1307: tests completed, needs refactoring