package com.atlassian.stash.internal.web.soy.functions;

import com.atlassian.bitbucket.pull.PullRequestState;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class LowerCaseFunctionTest {

    @Test
    public void testString() throws Exception {
        String str = "FOO";
        assertEquals("foo", new LowerCaseFunction().apply(str));
    }

    @Test
    public void testEnum() throws Exception {
        PullRequestState state = PullRequestState.MERGED;
        assertEquals("merged", new LowerCaseFunction().apply(state));
    }

    @Test(expected = IllegalArgumentException.class)
    public void testFailure() throws Exception {
        Integer n = 5;
        new LowerCaseFunction().apply(n);
    }
}
