Writing tests and methods with arrays