<?xml version="1.0" encoding="UTF-8"?>
<test-data
    xmlns="http://pmd.sourceforge.net/rule-tests"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://pmd.sourceforge.net/rule-tests http://pmd.sourceforge.net/rule-tests_1_0_0.xsd">

    <test-code>
        <description>short</description>
        <rule-property name="minimum">13</rule-property>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Foo {
    public void foo() {
        bar();
    }
}
        ]]></code>
    </test-code>

    <test-code>
        <description>lots of comments</description>
        <rule-property name="minimum">13</rule-property>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Foo {
    public void foo() {
        //nothing to see here
        //nothing to see here
        //nothing to see here
        //nothing to see here
        bar();
        //nothing to see here
        //nothing to see here
        //nothing to see here
        //nothing to see here
        foo();
    }
}
        ]]></code>
    </test-code>

    <code-fragment id="long-method"><![CDATA[
public class Foo {
    public void foo() {
        //nothing to see here
        //nothing to see here
        //nothing to see here
        //nothing to see here
        bar();
        bar();
        bar();
        bar();
        bar();
        bar();
        //nothing to see here
        //nothing to see here
        //nothing to see here
        //nothing to see here
        foo();
        foo();
        foo();
        foo();
        foo();
        foo();
    }
}
    ]]></code-fragment>

    <test-code>
        <description>long method</description>
        <rule-property name="minimum">13</rule-property>
        <expected-problems>1</expected-problems>
        <code-ref id="long-method"/>
    </test-code>

    <test-code>
        <description>long method - changed minimum</description>
        <!-- validated this number against NCSS -->
        <rule-property name="minimum">15</rule-property>
        <expected-problems>0</expected-problems>
        <code-ref id="long-method"/>
    </test-code>

    <test-code>
        <description>Github issue #251 - lines are counted properly</description>
        <rule-property name="minimum">10</rule-property>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
@isTest
private class AcceptanceTests_Test {

    @isTest
    private static void test() {
        // Setup
        Opportunity o1 = new Opportunity()
                                    .add(new Contact().foo(1)  .bar(1).year(2012)  .bar(1).price(5)  .vol(100))
                                    .add(new Contact().foo(1)  .bar(2).year(2013)  .bar(1).price(5)  .vol(110))
                                    .add(new Contact().foo(1)  .bar(3).year(2014)  .bar(1).price(5)  .vol(120))
                                    .add(new Contact().foo(1)  .bar(4).year(2015)  .bar(1).price(5)  .vol(130))
                                    .persist();

        // Verify
        System.assert(attribute());
    }
}
        ]]></code>
    </test-code>

    <test-code>
        <description>#1396 Method with comment</description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
/**
 * Class comment
 */
public class SomeClass {
    /**
     * Comment
     */
    public void doSomething() {
        System.debug('hello world');
    }

    /** Field comment */
    private String field;
}
        ]]></code>
    </test-code>
</test-data>
