Extend branch coverage in unit test with negative test cases