Add unit test for magn-4837

This pull request adds unit test for [MAGN-4837] (http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4837).

@riteshchandawar  please take a look.