Add unit test for magic set method