Add unit test for IF function.

Change-Id: I2265458883fb05582c54157714b88345362efa0d