def METHOD_NAME(self):
    file = NamedTemporaryFile(delete=False)
    file.write(b"""
    /// Monitor definition assigned to the test method:
    /// ```apm
    /// $foo = <foo value>
    /// $bar = <bar value>
    /// ```
    func test_method_name() {
    }
    """)
    file.close()
    expected_test_file = TestFile(
        test_methods=[
            TestMethod(
                method_name='test_method_name',
                monitors=[
                    MonitorConfiguration(
                        type='apm',
                        variables=[
                            MonitorVariable(
                                name='$foo',
                                value='<foo value>',
                                code_reference=CodeReference(
                                    file_path=file.name,
                                    line_no=4,
                                    line_text='/// $foo = <foo value>')
                            ),
                            MonitorVariable(
                                name='$bar',
                                value='<bar value>',
                                code_reference=CodeReference(
                                    file_path=file.name,
                                    line_no=5,
                                    line_text='/// $bar = <bar value>')
                            )
                        ],
                        code_reference=CodeReference(
                            file_path=file.name,
                            line_no=3,
                            line_text='/// ```'
                        ),
                        code='\n'.join(
                            [
                                '        /// Monitor definition assigned to the test method:',
                                '        /// ```apm',
                                '        /// $foo = <foo value>',
                                '        /// $bar = <bar value>',
                                '        /// ```',
                                '        func test_method_name() {',
                                '        }',
                                ''
                            ]
                        )
                    )
                ],
                code_reference=CodeReference(
                    file_path=file.name,
                    line_no=7,
                    line_text='        func test_method_name() {\n'
                ),
                code='\n'.join(
                    [
                        '        func test_method_name() {',
                        '        }',
                        ''
                    ]
                )
            )
        ],
        independent_monitors=[]
    )
    actual_test_file: TestFile = read_test_file(file.name)
    self.assertEqual(actual_test_file, expected_test_file)
    os.unlink(file.name)