TESTS: added unit tests to cover issue #505.
TESTS: added unit tests to cover issue #505.

iArnold/red,rheber/red,vehar/red,rheber/red,vehar/red,NikolayShubenkovProgSchool/red,red-eco/red,red-eco/red,NikolayShubenkovProgSchool/red,iArnold/red