Added test for code method.