test case getViewIndex method.