<?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>ok</description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class ShortMethodName0 {
    public int abcd( int i ) {
       // Should not violate.
    }
}
        ]]></code>
    </test-code>

    <test-code>
        <description>bad</description>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
public class ShortMethodName1 {
    public int a( int i ) {
       // Should violate.
    }
}
        ]]></code>
    </test-code>

    <test-code>
        <description>2 violations</description>
        <expected-problems>2</expected-problems>
        <code><![CDATA[
public class ShortMethodName2 {
    public int a( int i ) {
       // Should violate
    }

    public int b( int i ) {
       // Should violate
    }
}
        ]]></code>
    </test-code>

    <test-code>
        <description>2 methods, 1 violation</description>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
public class ShortMethodName3 {
    public int a( int i ) {
       // Should violate
    }

    public int bcde( int i ) {
       // Should not violate
    }
}
        ]]></code>
    </test-code>

    <test-code>
        <description>#1361 ShortMethodName configuration - 7 characters</description>
        <rule-property name="minimum">7</rule-property>
        <expected-problems>1</expected-problems>
        <expected-linenumbers>3</expected-linenumbers>
        <code><![CDATA[
public class ShortMethodName {
    public void longMethodName() {}
    public void foobar() {} // too short
}
        ]]></code>
    </test-code>

    <test-code>
        <description>#1361 ShortMethodName configuration - 1 characters</description>
        <rule-property name="minimum">1</rule-property>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class ShortMethodName {
    public void longMethodName() {}
    public void bar() {} // that's ok now
}
        ]]></code>
    </test-code>
</test-data>
