// Copyright (c) Keith D Gregory, all rights reserved
package com.kdgregory.example.coverage;

import junit.framework.TestCase;

/**
 *  Demonstrates that 100% coverage doesn't mean that all execution paths
 *  are covered.
 *
 *  If you have the EclEmma plugin installed for Eclipse, you can simply run
 *  using "Coverage As ... JUnit Test". Otherwise, you'll have to rename and
 *  fit into a build directory.
 */
public class MultipathExample
extends TestCase
{
    public static int testMe(int a, int b, int c)
    {
        if (a > 5)
            c += a;
        if (b > 5)
            c += b;
        return c;
    }


    public void test100PercentCoverage() throws Exception
    {
        assertEquals(2, testMe(2, 2, 2));
        assertEquals(21, testMe(7, 7, 7));
    }
}
