<?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">14</rule-property>
        <expected-problems>0</expected-problems>
        <code-ref id="long-method"/>
    </test-code>
    
    <test-code>
        <description>ignores constructor</description>
        <rule-property name="minimum">10</rule-property>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Foo {
    public Foo() {
		bar();
		bar();
		bar();
		bar();
		bar();
		bar();
		bar();
		bar();
		bar();
		bar();
		bar();
		bar();
		bar();
    }
}
		]]></code>
    </test-code>
    <test-code>
        <description>Github issue #183 - lines are counted properly</description>
        <rule-property name="minimum">10</rule-property>
        <expected-problems>0</expected-problems>
        <code>
@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-data>
