Writing Functional Test