[BUG #Bug 8561] Add unit tests