Added Test cases to test 99% of view code