Assert.fail will throw, causing the exception block to catch it and assumes that everything is ok. To achieve the intended logic, Assert.fail should be outside of the try{}catch{} and the logic should return in the catch clause.